STOP f4 for changing class section
#1

how to STOP f4 for changing class section . How can i stop players from changing skin by pressing f4 after getting killed?
Reply
#2

Its a default samp function, you can't change it.

But you may force him to use the same team and skin.

pawn Код:
new
        bool:ClassSpawned[ MAX_PLAYERS ] = 0,
        PlayerSkin[ MAX_PLAYERS ],
        PlayerTeam[ MAX_PLAYERS ] ;
public OnPlayerConnect( playerid )
{
    ClassSpawned[ playerid ] = false;
    PlayerSkin[ playerid ] = 0;
    PlayerTeam[ playerid ] = 0;
    return true;
}
public OnPlayerSpawn( playerid )
{
    if( ClassSpawned[ playerid ] == false )
    {
        ClassSpawned[ playerid ] = true;
        PlayerSkin [ playerid ] = GetPlayerSkin( playerid );
        PlayerTeam[ playerid ] = GetPlayerTeam( playerid ) ;
    }
    return true;
}
public OnPlayerRequestClass( playerid, classid )
{
    if( ClassSpawned[ playerid ] == true )
    {
        SetSpawnInfo( playerid, PlayerTeam[ playerid ], PlayerSkin[ playerid] , x, y, z, 90.0, 1, 0, 1, 1, 1, 1);//change those variables
        SpawnPlayer( playerid ) ;
    }
    return true;
}
Reply
#3

Try this out :

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
     
ForceClassSelection(playerid);
     
TogglePlayerSpectating(playeridtrue);
     
TogglePlayerSpectating(playeridfalse);
     return 
1;

KillerDVX,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)