14.10.2013, 21:52
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:
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.
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;
}