20.04.2013, 10:29
Alright.
When i do /makeleader , the leader gets invited into the faction and he will get tier 2 (highest), on stats it says: Faction rank: [] Faction tier: [2]
when he does /setrank he can edit his rank name, for example Hi
After that this happens:
Faction rank: [Hi] Faction tier: [ ]
Both of the CMD's:
(settier and setrank)
When i do /makeleader , the leader gets invited into the faction and he will get tier 2 (highest), on stats it says: Faction rank: [] Faction tier: [2]
when he does /setrank he can edit his rank name, for example Hi
After that this happens:
Faction rank: [Hi] Faction tier: [ ]
Both of the CMD's:
(settier and setrank)
Код:
CMD:settier(playerid, params[]) { new playerb, tier, 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, tier)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /settier [playerid] [tier]"); if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your tier."); 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(tier < 0 || tier > 2) return SendClientMessage(playerid, COLOR_GREY, "Tiers are between 0 and 2."); if(PlayerInfo[playerb][pFacTier] == tier) return SendClientMessage(playerid, COLOR_GREY, "Player already has that tier."); if(PlayerInfo[playerb][pFacTier] < tier) { PlayerInfo[playerb][pFacTier] = tier; format(string, sizeof(string), "You have {33AA33}promoted {33CCFF}%s to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has {33AA33}promoted {33CCFF}you to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); } else if(PlayerInfo[playerb][pFacTier] > tier) { PlayerInfo[playerb][pFacTier] = tier; format(string, sizeof(string), "You have {FF9900}demoted {33CCFF}%s to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has {FF9900}demoted {33CCFF}you to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); } return 1; } CMD:setrank(playerid, params[]) { new name[32], playerb, 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, "is[32]", playerb, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /adjustrankname [player] [name]"); { format(PlayerInfo[playerb][pFRank], 32,"%s", params); format(string, sizeof(string), "You have editted the rankname to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } return 1; }