new
adminSkin
;
public OnGameModeInit( )
{
AddPlayerClass( 0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, -1, -1, -1 ); // Regular player skin
adminSkin = AddPlayerClass( 250, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, -1, -1, -1 ); // Administrator's Skin
}
new
isDenied[ MAX_PLAYERS ]
;
public OnPlayerRequestClass( playerid, classid )
{
if ( classid == adminSkin && !IsPlayerAdmin( playerid ) ) {
isDenied[ playerid ] = 1; GameTextForPlayer( playerid, "~w~Restricted skin ", 1000, 3 );
}
else
isDenied[ playerid ] = 0;
return 1;
}
public OnPlayerRequestSpawn( playerid )
{
if ( isDenied[ playerid ] == 1 ) {
SendClientMessage( playerid, -1, "RESTRICTED SKIN" );
return 0;
}
return 1;
}
I would prefer to have skins that are unavailable to the player to be hidden if possible. |