07.04.2018, 22:21
Quote:
Код:
CMD:giverank(playerid, params[]) { new playerb, rank, string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader."); if(sscanf(params, "ui", playerb, rank)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giverank [playerid][rank]"); if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your rank."); if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player ID."); if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction."); if(rank < 0 || rank > return SendClientMessage(playerid, COLOR_GREY, "Ranks are between 0 and 8."); if(PlayerInfo[playerb][pFacRank] == rank) return SendClientMessage(playerid, COLOR_GREY, "Player already has that rank."); if(PlayerInfo[playerb][pFacRank] < rank) { PlayerInfo[playerb][pFacRank] = rank; format(string, sizeof(string), "You have {33AA33}promoted {33CCFF}%s to {33AA33}%s (%d){33CCFF}.", GetPlayerNameEx(playerb), RPFRN(playerb), rank); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has {33AA33}promoted {33CCFF}you to {33AA33}%s (%d){33CCFF}.", GetPlayerNameEx(playerid), RPFRN(playerb), rank); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); } else if(PlayerInfo[playerb][pFacRank] > rank) { PlayerInfo[playerb][pFacRank] = rank; format(string, sizeof(string), "You have {FF9900}demoted {33CCFF}%s to {FF9900}%s (%d){33CCFF}.", GetPlayerNameEx(playerb), RPFRN(playerb), rank); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has {FF9900}demoted {33CCFF}you to {FF9900}%s (%d){33CCFF}.", GetPlayerNameEx(playerid), RPFRN(playerb), rank); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); } return 1; } |
so please explain them what was their mistakes.