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; }
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 isn't connected!");
if(pInfo[Reciver][pFaction] > 0)return SendClientMessage(playerid,FactColor[11],"That player is already in a faction!");
pInfo[Reciver][pFaction] = pInfo[playerid][pLeader];
pInfo[Reciver][pRank] = 1;
INI_WriteInt(INI_Open(UserPath(Revier)),"Faction",pInfo[playerid][pLeader]);
INI_WriteInt(INI_Open(UserPath(Reciver)),"Rank",1);
INI_Close(INI_Open(UserPath(Reciver)));
new string[2][145];
format(string[0],sizeof string[0],"You have been invited by %s in %s!",Name(playerid),pFacts[pInfo[playerid][pLeader]]);
format(string[1],sizeof string[1],"You invited %s in your faction!",Name(Reciver));
SendClientMessage(playerid,FactColor[10],string[1]);
SendClientMessage(Reciver,FactColor[10],string[0]);
SetPlayerColor(Reciver,FactColor[pInfo[playerid][pFaction]]);
ForceClassSelection(Reciver);
SetPlayerHealth(Reciver,0.0);
return 1;
}
Hello!
PHP код:
|