Regarding the NoDriveBy script
I would like to ask if my understanding is correct. (I know there might be parts when you say duh, it’s literally there but bear with me)
In regards to the script, by default, it allows players to shoot out from the passenger seat.
When it goes to the other chunk of codes…
The first IF statement
I believe, from my understanding, that when there’s a person in a car, it checks if a person is in the main driver seat of the vehicle (basically the driver seat), it does not allow the civilian in the driver seat to shoot.
If I want to allow this, I’ll need to change SetPlayerCanDoDriveBy(PlayerId(), false) to SetPlayerCanDoDriveBy(PlayerId(), true).
The first ELSEIF statement
This basically re-iterates my first point that the passenger of the vehicle is able to shoot.
The first ELSE statement
If the requirement doesn’t meet either of the requirements for some reason, they’re not able to shoot.
-- CONFIG --
-- Allow passengers to shoot
local passengerDriveBy = true
-- CODE --
while true do
playerPed = GetPlayerPed(-1)
car = GetVehiclePedIsIn(playerPed, false)
if car then
if GetPedInVehicleSeat(car, -1) == playerPed then
elseif passengerDriveBy then
The main question
Now if I understand this correctly, this means there are variables pre-set for me to use?
At least from what I learned in school, things like GetVehiclePedIsIn and GetPlayerPed are pre-defined functions that has already been made to intake certain variables.
If my theory is correct, then is there a list of pre-defined functions somewhere that I can use? and if my theory is wrong, could I be enlightened on how it works?
I’m trying to code out a scenario whereby I allow the driver to do a shootout but only with a specific weapon.
So with that, my thoughts would be something along the line of this:
if GetPedInVehicleSeat(car, -1) == playerPed and GetPedWeapon() == “WEAPON_MARKSMANPISTOL”:
In wordings, if the person in the driver seat is present and they’re holding a weapon called a marksman pistol, it allows them to shoot with that weapon. I don’t know GetPedWeapon() is an actual function but seeing the naming methods that has been put out, I’m just throwing something that sounds like how I think it would appear.
Thanks in advance,