26.07.2015, 21:00
Need help with /invite command - When i invite a player in my faction it says unknown command but the command make player join my faction ... Why it's that happen ??
P.S: That command invite a player in his(leader) faction :P
Код:
CMD:invite(playerid, params[]) { if(pInfo[playerid][pLeader] == 0) return SendClientMessage(playerid, FactColor[11], "You need to be a leader to use that command !"); new Reciver; if(sscanf(params, "u", Reciver)) return SendClientMessage(playerid, FactColor[11], "USAGE: /invite [PlayerID/PartOfName]"); if(Reciver == playerid) return SendClientMessage(playerid, FactColor[11], "You can't invite yourself !"); if(!IsPlayerConnected(Reciver)) return SendClientMessage(playerid, FactColor[11], "That player it's not connected !"); if(pInfo[Reciver][pFaction] > 0) return SendClientMessage(playerid, FactColor[11], "That player it's aldreay in one faction !"); pInfo[Reciver][pFaction] = pInfo[playerid][pLeader]; pInfo[Reciver][pRank] = 1; INI_WriteInt(INI_Open(UserPath(Reciver)), "Faction", pInfo[playerid][pLeader]); INI_WriteInt(INI_Open(UserPath(Reciver)), "Rank", 1); INI_Close(INI_Open(UserPath(Reciver))); new String[128], String2[128]; format(String, sizeof(String), "You have been invited by %s in %s !", Name(playerid), pFacts[pInfo[playerid][pLeader]]); format(String2, sizeof(String2), "You invited %s in your faction !", Name(Reciver)); SendClientMessage(playerid, FactColor[10], String2); SendClientMessage(Reciver, FactColor[10], String); SetPlayerColor(Reciver, FactColor[pInfo[playerid][pFaction]]); ForceClassSelection(Reciver); SetPlayerHealth(Reciver, 0.0); return 1; }