Jump to content

Recommended Posts

Hello,

me and my friends want to write a script that you can use to get into any locked vehicle.

This function should only be possible for the civilian faction.

And we are stuck, we are all new to SQF.

Thanks for your help.

Share this post


Link to post
Share on other sites

If (side player isEqualTo civilian) then {player moveInAny _vehicleObject;};

 

this is not the solution but could be part of it.

 

A good way to get a specific answer is to ask a specific question AND to show what you tried already.

Only very few guys will do all the work for you and give you your all-in-one-solution...

Share this post


Link to post
Share on other sites

In the init field of the vehicle, just write:

 

if (local this) then {
  this lock 2;
  this addAction ["Unlock the vehicle", {
    params ["_veh","_plyr","_id"];
    if (locked _veh >1) then {
      [_veh,0] remoteExec ["lock",_veh];
      _veh setUserActionText [_id,"Lock the vehicle"];
    } else {
      [_veh,2] remoteExec ["lock",_veh];
      _veh setUserActionText [_id,"Unlock the vehicle"];
    };
  },nil,6,false,false,"","side _this == civilian",12];
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×