21.12.2009, 16:09
Код:
if(strcmp(cmd, "/rank", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ALLDEPT, "Use /rank [id]"); return 1; } if (giveplayerid == INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_ALLDEPT, "Player is not connected"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(targetid, name, sizeof(name)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { new currank[64]; new string[128]; if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; } else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officer"; } else if(PlayerInfo[playerid][pRank] == 3) { currank = "Senior Officer"; } else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; } else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; } else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; } else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; } else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; } else { currank = "Cadet"; } format(string, sizeof(string), "%d SAPD Rank Is %s", targetid, currank); SendClientMessage(playerid,COLOR_GREEN1337, string); SendClientMessage(playerid,COLOR_GREEN1337,"Has normal rights when on duty"); } else { SendClientMessage(playerid, COLOR_ALLDEPT, "You are not a cop"); } } return 1; }
What is wronge with this ?