SA-MP Forums Archive
Class Specific Skins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Class Specific Skins (/showthread.php?tid=261995)



Class Specific Skins - Battleskull - 16.06.2011

How do I make it so that only certain classes/professions can choose certain skins and block regular players from using them.

I would prefer to have skins that are unavailable to the player to be hidden if possible.


Re: Class Specific Skins - Basicz - 16.06.2011

pawn Код:
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;
}
Quote:

I would prefer to have skins that are unavailable to the player to be hidden if possible.

Hmm, I don't know about that one, but maybe ******'s Server Includes ( which have a custom player class adding ) may help you.