05.04.2010, 20:00
Hello,wanted to make /promote,but its bugged,if i write anything,/safasfa,it will promote me to principal,(idk,if it was for id 0,cuz i was lonley in server).
Код:
if(strcmp(cmd, "/promote", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new giveplayer[MAX_PLAYER_NAME];
new tmp[256];
new idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /promote [playerid/PartOfName]");
return 1;
}
new para1;
para1 = strval(tmp);
if(para1 != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(para1))
{
if(IsPlayerAdmin(playerid))
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), " You have promoted %s to Principal.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][fLeader] = 1;
SetPlayerSkin(playerid,295);
}
else
{
SendClientMessage(para1, COLOR_YELLOW, "Error: Your not in the same gang!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command(leaders only)!");
}
}
}
return 1;
}

