27.12.2017, 05:57
So I am having issues with /dep. It never returns the correct Faction Abbreviation before the message; Example Player A is LSPD and Player B is SASD. Player A types this /dep PD 101 for SD 240. It will come out as this;
[SASD] RankOfPlayerA PlayerA'sName: PD 101 for SD 240.
And the same for SD
[LSPD] RankOfPlayerB PlayerB'sName: SD 240 for PD 101.
Here is my code if someone could help...
[SASD] RankOfPlayerA PlayerA'sName: PD 101 for SD 240.
And the same for SD
[LSPD] RankOfPlayerB PlayerB'sName: SD 240 for PD 101.
Here is my code if someone could help...
Код:
alias:department("dep"); CMD:department(playerid, params[]) { if(!PlayerInfo[playerid][pFaction]) return SendErrorMessage(playerid, "You aren't in any faction."); if(FactionInfo[PlayerInfo[playerid][pFaction]][eFactionType] != FACTION_TYPE_POLICE && FactionInfo[PlayerInfo[playerid][pFaction]][eFactionType] != FACTION_TYPE_MEDICAL && FactionInfo[PlayerInfo[playerid][pFaction]][eFactionType] != FACTION_TYPE_DOC) return SendClientMessage(playerid, COLOR_RED, "ACCESS DENIED:{FFFFFF} You can't use this command."); if(isnull(params)) return SendUsageMessage(playerid, "/(dep)artment [text]"); if(PlayerInfo[playerid][pLoggedin] && GetPlayerTeam(playerid) != PLAYER_STATE_ALIVE) { SendServerMessage(playerid, "You can't talk when you aren't alive."); return 0; } foreach(new i : Player) { new factionid; factionid = PlayerInfo[i][pFaction]; if(FactionInfo[factionid][eFactionType] == FACTION_TYPE_POLICE || FactionInfo[factionid][eFactionType] == FACTION_TYPE_MEDICAL || FactionInfo[factionid][eFactionType] == FACTION_TYPE_DOC) { sendMessage(i, COLOR_DEPT, "** [%s] %s %s: %s", FactionInfo[factionid][eFactionAbbrev], ReturnFactionRank(playerid), ReturnName(playerid, 0), params); } } new Float:posx, Float:posy, Float:posz; GetPlayerPos(playerid, posx,posy,posz); foreach(new i : Player) { if(i == playerid) continue; else if(IsPlayerInRangeOfPoint(i, 20.0, posx,posy,posz)) { sendMessage(i, COLOR_GRAD1, "%s says (radio): %s", ReturnName(playerid, 0), params); } } return 1; }