SA-MP Forums Archive
Disable drive-by. - 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: Disable drive-by. (/showthread.php?tid=233648)



Disable drive-by. - Tomejus - 02.03.2011

Is it possible to disable drive-by?


Re: Disable drive-by. - (SF)Noobanatior - 02.03.2011

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


Re: Disable drive-by. - Ironboy - 02.03.2011

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


Re: Disable drive-by. - Mean - 02.03.2011

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;
}



Re: Disable drive-by. - Tomejus - 02.03.2011

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