STOP f4 for changing class section - 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)
+--- Thread: STOP f4 for changing class section (
/showthread.php?tid=581287)
STOP f4 for changing class section -
ALoX12 - 11.07.2015
how to STOP f4 for changing class section . How can i stop players from changing skin by pressing f4 after getting killed?
Re: STOP f4 for changing class section -
SilentSoul - 12.07.2015
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;
}
Re : STOP f4 for changing class section -
KillerDVX - 12.07.2015
Try this out :
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
return 1;
}
KillerDVX,