• 0
Repentz

Removing a variable if outside vehicle question

Question

I'm trying to make a seatbelt script, if you go inside and scrollwheel to put it on it enables seatbelt, you scrollwheel to take it off aswell, but my problem is when players jump out and back in they still have it. here's what is supposed to fix it:            I need it to call when a player is outside a vehicle to turn the variable to false.

while {true} do
{
  if (!(vehicle player) isKindOf "Car" && ex_seatbelt) then
  {
    ex_seatbelt = false;
  };
};

 

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Posted (edited)

Add the variable with the GetIn eventhandler
you'd have to add this to a vehicle in ExileServer_object_vehicle_createNonPersistentVehicle.sqf and ExileServer_object_vehicle_createPersistentVehicle.sqf):
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetIn

and remove it when they exit the vehicle with the GetOut eventhandler (also added in the vehicle spawn script overrides)

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOut

Edited by second_coming

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.