SetPlayerTeam
#1

Hello. I'm scripting an event-system and I want it so, when player joins the event, it will save his team to the variable and then, when event ends/he leaves it will set it back. Is this the correct way to do it?

pawn Код:
new teamcrap[MAX_PLAYERS];

CMD:join(playerid,params[])
{
    teamcrap[playerid] = GetPlayerTeam(playerid);
    joined[playerid] = 1;
    return 1;
}

CMD:endevent(playerid,params[])
{
    foreach (new i : Player)
    {
        if(joined[i] == 1)
        {
            joined[i] = 0;
            SetPlayerTeam(i, teamcrap[i]);
        }
    }
    return 1;
}
I want to make sure I got it right.
Reply


Messages In This Thread
SetPlayerTeam - by exclide1 - 30.06.2013, 01:20
Respuesta: SetPlayerTeam - by JustBored - 30.06.2013, 05:15
Re: SetPlayerTeam - by ScRipTeRi - 30.06.2013, 08:43
Re: SetPlayerTeam - by Sellize - 30.06.2013, 09:21

Forum Jump:


Users browsing this thread: 1 Guest(s)