OnPlayerRequestSpawn
#5

Yea, I forgot to add something else, this is how I did under OnPlayerRequestSpawn to prevent someone from spawning i.e. with an admin skin whilst they're not an admin:

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_ADMINS && PlayerData[playerid][pAdmin] <= 0)
    {
        new string[200];
        format(string, sizeof(string), "Only administrators of the server can use this skin.");
        SendClientMessage(playerid, COLOR_RED, string);
        return 0;
    }
    if(gPlayerRegistered[playerid] == 1 && gPlayerLogged[playerid] == 0)
    {
        new string[200];
        format(string, sizeof(string), "This account is registered, you must login before proceeding with a spawn.");
        SendClientMessage(playerid, COLOR_RED, string);
        return 0;
    }
    else if(gPlayerRegistered[playerid] == 1 && gPlayerLogged[playerid] == 1)
    {
        return 1;
    }
    else if(gPlayerRegistered[playerid] == 0 && gPlayerLogged[playerid] == 0)
    {
        return 1;
    }
    return 1;
}
I'm setting the teams at OnPlayerRequestClass, and then upon OnPlayerRequestSpawn, if that team is X and the player is not Y, then it will return 0 to stop the player from spawning. You could do this with global variables too instead of setting the teams straight away.
Reply


Messages In This Thread
OnPlayerRequestSpawn - by AnonScripter - 14.10.2013, 21:01
Re: OnPlayerRequestSpawn - by DanishHaq - 14.10.2013, 21:15
Re: OnPlayerRequestSpawn - by AnonScripter - 14.10.2013, 21:46
Re: OnPlayerRequestSpawn - by Patrick - 14.10.2013, 21:52
Re: OnPlayerRequestSpawn - by DanishHaq - 14.10.2013, 21:52
Re: OnPlayerRequestSpawn - by AnonScripter - 14.10.2013, 22:00
Re: OnPlayerRequestSpawn - by Patrick - 14.10.2013, 22:03
Re: OnPlayerRequestSpawn - by AnonScripter - 14.10.2013, 22:12

Forum Jump:


Users browsing this thread: 1 Guest(s)