17.03.2010, 20:32
Sup, I got a small problem with one f my commands, this command should remove a players admin rank and set it to 0.
Well, it dosn't, the player got the same rank, what is wrong?
Thansk
Код:
if(strcmp(cmd, "/removeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, " USAGE: /removeadmin [playerid]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(PlayerInfo[playerid][pAdminLevel] >= 10)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[giveplayerid][pAdminLevel] = 0;
format(string, sizeof(string), "AdmCmd: %s had his/her Admin Level removed by %s.", giveplayer, sendername);
SendClientMessageToAll(COLOR_RED, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " Identification Error - You need admin level 10 to do this.");
return 1;
}
}
return 1;
}
Thansk


