OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Joukov on 24 Oct 2005, 02:53:46
-
Hokay, ;D
So i created this map where the player has to go someways to get to his objective, he has a car at his disposal. i made it so that when he gets into the car he gets two new actions: Play Aight, and Play spetsnaz; those are the two songs that the player can listen to while driving to the obj. I just have one problem with this whole thing. I want the two actions to disappear when the player gets out of the car. I found how to detect if a certain player enters a certain car, but i stil don't know how to detect if a certain player leaves a certain car... Anyone know?
-
? (vehiclePlayer != player) : myAction = player addAction ["BLAH","Blah.sqs"]
and
? (vehiclePlayer == player) : player removeAction "MyAction"
or the equivelent in a trigger
-
what is vehiclePlayer?
name of the vehicle?
-
Ok, nm, i get it now
but it still doesn't work...
maybe if i show you my trigger you will see the problem..
I have a car named "truck", and a guy named "player",
in the "player" init field i declared a variable "r1" and set it to false, then i made a trigger in the condition of which i put "Player in Truck", in the On Activation field i put "PlayAight = truck addaction ["Play Aight","aight.sqs"]; r1 = true". I then made a second trigger in the init of which i put, as you said, "truck != player and r1", in the On activation i put "truck removeaction "PlayAight "; r1 = false; hint "stuff"". Both the triggers are turned on as "repeatedly". As you can see i added the "r1", this is because without it the game would right away go to the second trigger and it would not activate that trigger again. Now that i have the r1, it doesnt activate the second trigger at the beggining of the game, but when i get into the "truck", it adds the actions for a second, then removes them with the hint"stuff". My best guees is that there is something wrong with the "truck != player" command... ne one know how to solve this?
-
no you shouldnt of changed it to say truck
vehiclePlayer is a command not the name of the truck if you change truck back to vehiclePlayer it should work fine
-
It should be vehicle player, not vehiclePlayer.
That would then enable the action if the player is in any vehicle. If there's only one unlocked vehicle in your mission, or you allow the action to be present no matter what the vehicle is, then vehicle player in the above code example would work just fine.
-
thanks guys
topic solved!