Jump to content
b2020b

I want to show this option only when riding in vehicle

Recommended Posts

I want to show this option only when riding in any vehicle and when stopped

However, this option is displayed even when not in the vehicle.

https://ibb.co/0Vwb5My

what's the problem

plz help me

 

 

//player addAction [("<t color=""#66FFFF"">" + ("Repair/Flip") +"</t>"), "repair.sqf", [], 0, false,true, "", "player in(_vehicle _target) && {speed _target < 1}"];

Share this post


Link to post
Share on other sites

That's because vehicle player and player are same when on foot 😊

try instead:

player addAction [("<t color=""#66FFFF"">" + ("Repair/Flip") +"</t>"), "repair.sqf", [], 0, false,true, "", "!isNull objectParent _this && {speed _this < 1}"];

 

  • Like 4

Share this post


Link to post
Share on other sites
7 hours ago, pierremgi said:

vehicle player and player

Due to this the following would also work

(vehicle player) != player

And was the only way to do this for a very long time. But nowadays, the "objectParent" method is better because it runs faster

  • Like 2

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

×