30.01.2010, 10:42
I did a command which half of it the if's part work but the last piece don't
In my opinion there is nothing wrong with this command... but somehow it don't wanna work.
Код:
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; } 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. PlayerInfo[giveplayerid][policerank] += 1; SavePlayer(giveplayerid); SendMessageToPolice(COLOR_LIGHTBLUE,string); return 1; }