Prevent shooting out of any car?
#1

Is there a way to prevent shooting out of cars whether the player is the driver or not?
Reply
#2

Just set their armed weapon to 0 when they get in a car you can also check when they fire a weapon just in case.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE &&
        IsPlayerInAnyVehicle(playerid) &&
        GetPlayerWeapon(playerid) != 0)
        SetPlayerArmedWeapon(playerid, 0);
    return 1;
}
Reply
#3

How do I handle if someone press "H" to hang out of the car?
Reply
#4

Use KEY_CROUCH.
https://sampwiki.blast.hk/wiki/Keys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)