/invite and /acceptinvite not working :/
#7

I have this now:

pawn Код:
CMD:invite(playerid, params[])
{
    new player;
    if(sscanf(params, "u", player)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /invite [playerid / name]");
    if(player != INVALID_PLAYER_ID)
    {
        if(PlayerInfo[playerid][pLeader] == 1 && 1 <= PlayerInfo[playerid][pTeam] <= 7)
        {
            new string[128];
            new stringtarget[128];
            new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
            GetPlayerName(player, pName, MAX_PLAYER_NAME);
            invitedFor[player] = PlayerInfo[playerid][pTeam];
            format(string, sizeof(string), "You have invited %s to join %s", pName, FactionStatus(playerid));
            format(stringtarget, sizeof(stringtarget), "You have been invited to join %s. Type "COL_RED"/acceptinvite"COL_WHITE" to join!", FactionStatus(playerid));
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, stringtarget);
        }
        else
        {
            SendClientMessage(playerid, -1, "* Only leaders can use this command!");
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "* The player is not online.");
    }
    return 1;
}
And

pawn Код:
CMD:acceptinvite(playerid, params[])
{
    new player;
    if(player != INVALID_PLAYER_ID)
    {
        new string[128];
        new aName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
        if(1 <= invitedFor[playerid] <= 7)
        {
            PlayerInfo[playerid][pTeam] = invitedFor[playerid];
            PlayerInfo[playerid][pLeader] = 0;
            PlayerInfo[playerid][pRank] = 1;
            format(string, sizeof(string), "You have accepted the invitation and you are now part of %s", FactionStatus(playerid));
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            invitedFor[playerid] = 0;
        } else
        {
            SendClientMessage(playerid, -1, "You dont have a pending invitation!");
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "* The player is not online.");
    }
    return 1;
}

Only when im in faction 1 and I do: /invite arjan I get "bla bla /acceptinvite".
All other number of factions (2/3/4/5/6/7) give me: "* Only leaders can use this command"
Reply


Messages In This Thread
/invite and /acceptinvite not working :/ - by arjanforgames - 15.07.2013, 10:02
Re: /invite and /acceptinvite not working :/ - by Misiur - 15.07.2013, 10:06
Re: /invite and /acceptinvite not working :/ - by arjanforgames - 15.07.2013, 11:12
Re: /invite and /acceptinvite not working :/ - by Misiur - 15.07.2013, 12:48
Re: /invite and /acceptinvite not working :/ - by arjanforgames - 15.07.2013, 12:50
Re: /invite and /acceptinvite not working :/ - by Misiur - 15.07.2013, 13:14
Re: /invite and /acceptinvite not working :/ - by arjanforgames - 15.07.2013, 13:20

Forum Jump:


Users browsing this thread: 1 Guest(s)