30.01.2010, 11:09
Just try this out for the command, then we`ll know:
Код:
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;
}
new opstr[128];
format(opstr, sizeof(opstr),"(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.
PlayerInfo[giveplayerid][policerank] += 1;
SavePlayer(giveplayerid);
SendMessageToPolice(COLOR_LIGHTBLUE,opstr);
return 1;
}

