Hallo, was mache ich hier falsch?
Wenn ich /makeadmin playerid rank eingebe
Steht da immer Projektleiter und nicht automatisch den switch.
COMMAND:makeadmin(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid,6))return SendClientMessage(playerid,rot,"Du bist nicht mindestestens Adminrank High-Admin");
{
if(GetPVarInt(playerid,"Adminlevel") == 0)return SendClientMessage(playerid,rot,"Du bist nicht mindestestens Adminrank High-Admin!");
SendClientMessage(playerid,blau,"0.Zivilist");
SendClientMessage(playerid,blau,"1.Supporter auf Probe");
SendClientMessage(playerid,blau,"2.Supporter");
SendClientMessage(playerid,blau,"3.Moderrator");
SendClientMessage(playerid,blau,"4.Super Moderrator");
SendClientMessage(playerid,blau,"5.Sponsor");
SendClientMessage(playerid,blau,"6.Administrator");
SendClientMessage(playerid,blau,"7.High-Admin");
SendClientMessage(playerid,blau,"8.Stellv. Projektleiter");
SendClientMessage(playerid,blau,"9.Projektleiter");
SendClientMessage(playerid,blau,"10.Serverleiter");
new pID, rank;
if(sscanf(params,"ui",pID,rank))return SendClientMessage(playerid,rot,"Tippe: /makeadmin [Spielerid] [Rang]");
if(rank >= 0 && rank <= 10 )
{
SetPVarInt(pID,"Adminlevel",rank);
new playername[24];
GetPlayerName(pID, playername, 24);
new adminname[24];
GetPlayerName(playerid, adminname, 24);
SpielerSpeichern(pID);
new adminrankname[64];
switch(GetPVarInt(playerid,"Adminlevel"))
{
case 0:{adminrankname= "Zivilist";}
case 1:{adminrankname= "Supporter auf Probe";}
case 2:{adminrankname= "Supporter";}
case 3:{adminrankname= "Moderrator";}
case 4:{adminrankname= "Super Moderrator";}
case 5:{adminrankname= "Sponsor";}
case 6:{adminrankname= "Administrator";}
case 7:{adminrankname= "High-Admin";}
case 8:{adminrankname= "Stellv. Projektleiter";}
case 9:{adminrankname= "Projektleiter";}
case 10:{adminrankname= "Serverleiter";}
}
new string[128];
new string2[128];
format(string, sizeof(string),"Du hast %s zum [Adminrank: %s] eingestellt!",playername,adminrankname);
SendClientMessage(playerid,blau,string);
format(string2, sizeof(string2),"Admin %s hat dich zum [Adminrank: %s] eingestellt!",adminname,adminrankname);
SendClientMessage(pID,blau,string2);
}else SendClientMessage(playerid,rot,"Bitte gültigen Rang angeben (1-10)");
}
return 1;
}