Hello, I've found a script to place the player on the roof of a moving truck. The player is not able to move, but that's not my problem.
I want the script to exit via an addaction, but I don't know how to do this to do in sqf format. Actually... in sqs either
Here is the script:
_Unit=_This Select 0;
_Vehicle=_This Select 1;
_Unit SetPos (_Vehicle ModelToWorld [0,-3,1.26]);
//STARTTRUCK=True;
WaitUntil
{
_Unit SetVelocity (Velocity _Vehicle);
_Unit SetPos (_Vehicle ModelToWorld [0,-3,1.27]);
_VUp=VectorUp _Vehicle;
_VDir=VectorDir _Vehicle;
_Unit SetvectorUp _VUp;
_Unit SetvectorDir _VDir;
};
First question...
Is the line
//STARTTRUCK=True; a comment? When I delete this line the script still works.
Second question...
I think the position & vector of player and truck needs to be updated when the truck starts moving, but I don't see a loop here...
Waituntil doesn't create a loop AFAIK. Where is the condition?
Third question...
How can I exit the script via an addaction? I want to create an action "jump of the roof" that exits the script. I would add one of the rollanimations when the player gets of the roof to make it look better.
Left roll = "amovppnemstpsnonwnondnon_amovppnemevasnonwnondl"
Right roll = "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"
PS: I've read Cheetah's basic sqf tutorial but I still don't get it