Disable drive-by.
#1

Is it possible to disable drive-by?
Reply
#2

yes you can take the semi auto weapons off them when they get in the car save it and give em back when they get out
Reply
#3

Make a rule, that "Drive by is not allowed" :P
Reply
#4

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

Thank you fellas. If I add some additional code in OnPlayerUpdate (vehicle windows checking is open or not ) it's not very bad? I don't want lag u know. ; D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)