09.03.2012, 23:33
I'm having a problem with a /giverank command.
For some reason, any player can give himself a rank in any organization (even a civilian can give himself a rank, like the civilians are an organization !!!)
I really need some help, here is the command:
For some reason, any player can give himself a rank in any organization (even a civilian can give himself a rank, like the civilians are an organization !!!)
I really need some help, here is the command:
Код:
if(strcmp(cmd, "/giverank", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_DGOLD, "Use: /giverank [playerid/PartOfName] [Number(1-6)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[para1][pLeader] < 0) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: You can't change the rank of leaders!"); return 1; } if(level > 6 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " SERVER: The ranks are between 1 and 6!"); return 1; } { if(PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[para1][pMember] != 1) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: Nemozete dati rank igracu koji nije u vasoj organizaciji."); return 1; } if(PlayerInfo[playerid][pLeader] == 2 && PlayerInfo[para1][pMember] != 2) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 3 && PlayerInfo[para1][pMember] != 3) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 4 && PlayerInfo[para1][pMember] != 4) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 5 && PlayerInfo[para1][pMember] != 5) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 6 && PlayerInfo[para1][pMember] != 6) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 7 && PlayerInfo[para1][pMember] != 7) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 8 && PlayerInfo[para1][pMember] != 8) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 9 && PlayerInfo[para1][pMember] != 9) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; } if(PlayerInfo[playerid][pLeader] == 11 && PlayerInfo[para1][pMember] != 11) { SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!"); return 1; }