02.03.2011, 09:17
Add this to OnPlayerStateChange to disable drive-by.
This can fail sometimes, so you can use OnPlayerUpdate. This small code in OnPlayerUpdate will not cause lag:
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER )
{
SetPlayerArmedWeapon( playerid, 0 );
}
return 1;
}
pawn Код:
public OnPlayerUpdate( playerid )
{
if( IsPlayerInAnyVehicle( playerid ) )
{
SetPlayerArmedWeapon( playerid, 0 );
}
return 1;
}