Faction invite
#5

I think that i've fixed your errors, but from what I can see, you aren't inviting the player but setting his faction and rank right away.
PHP Code:
ReturnFactionName(playerid)
{
    new 
string[64];
    switch(
PlayerInfo[playerid][pFaction])
    {
        case 
1string "State Police";
        case 
2string "Federal Security Directorate";
        default: 
string "Undentified";
    }
    return 
string;
}
CMD:invite(playeridparams[])
{
    new 
id;
    if(
PlayerInfo[playerid][pFaction] < 1) return SendClientMessage(playeridCOLOR_RED"You are not in a faction");
    if(
sscanf(params,"u"id)) return SendClientMessage(playerid, -1,"USAGE: /invite [ID]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_RED"ERROR: Player is not connected!");
    
PlayerInfo[id][pFaction] = PlayerInfo[playerid][pFaction]; // This should be done after player accept the invite
    
PlayerInfo[id][pFacRanks] = 1// As well as this 
    
SendClientMessageEx(targetidCOLOR_AQUA"%s has invited you to join the %s"ReturnName(playerid), ReturnFactionName(playerid));
    
SendClientMessageEx(playeridCOLOR_AQUA"You have invited %s to %s"ReturnName(id), ReturnFactionName(playerid));
    return 
1;

Reply


Messages In This Thread
Faction invite - by Mo123 - 25.11.2018, 14:49
Re: Faction invite - by Amads - 25.11.2018, 14:54
Re: Faction invite - by Mo123 - 25.11.2018, 15:09
Re: Faction invite - by Devon007 - 25.11.2018, 16:29
Re: Faction invite - by Iguman - 25.11.2018, 20:37

Forum Jump:


Users browsing this thread: 4 Guest(s)