30.01.2010, 11:11
And if that doesn`t work try this one:
Код:
if(strcmp(cmd, "/promote", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: /promote [playerid]");
return 1;
}
giveplayerid = strval(tmp);
if(PlayerInfo[playerid][policerank] != 4)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Only the chief can use this command!");
return 1;
}
if(PlayerInfo[giveplayerid][policerank] == 0)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"This player is not in the police force!");
return 1;
}
if(PlayerInfo[giveplayerid][policerank] == 3) // Till here is working...
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot promote from Captian to Chief!");
return 1;
}
PlayerInfo[giveplayerid][policerank]++;
format(string, sizeof(string),"(PD Radio) Congratulations to %s , got promoted from %s to %s",PlayerInfo[giveplayerid][name],PoliceRank[PlayerInfo[playerid][policerank]-1][0],PoliceRank[PlayerInfo[playerid][policerank]][0]); // From here onwards don't work.
SavePlayer(giveplayerid);
SendMessageToPolice(COLOR_LIGHTBLUE,string);
return 1;
}

