Jump to content
Sign in to follow this  
Patou

Respawning identity

Recommended Posts

My goal is to detect a player driving a specific vehicle he doesn't own at start.

I made a empty vehicle nammed "tanka" that respawn with this script

?!(isServer) : exit

private ["_ap","_temps","_ve","_dir","_pos"]

_ap = _this select 0

_temps = _this select 1

_nom = _this select 2

_ve = typeOf _ap

_dir = getDir _ap

_pos = getPos _ap

if(isNil("_temps")) then {_temps = 30};

#boucle

@ ((!alive _ap) || (!canMove _ap))

if((!alive _ap) || (!canMove _ap)) then{goto "detruitrespawn"}

~0.1

goto "boucle"

#detruitrespawn

~_temps

deleteVehicle _ap

~0.1

?(isServer):_ap=_ve createVehicle _pos

_ap setDir _dir

_ap setIdentity "tanka"

~0.1

goto "boucle"

I use triggers activated by side and with condition:

this && tanka in thisList

I works fine if the tank doesn't respawn but once it has respawn the triggers doesn't work. Any solutions?

What i want is:

-It triggers only with this vehicle and not other vehicles.

-It detects side of player driving or it puts side of player driving in a variable.

Share this post


Link to post
Share on other sites

I'm still stuck on this. If anyone have an idea he would be welcome ;)

Share this post


Link to post
Share on other sites

Hi,

even if you solved your problem by using another respawn script, let me explain what I think is the reason for the misfunction of your own script.

I think the setIdentity command is not the correct one for this intention. It should work with the command

_ap setVehicleInit "tanka=this";
processInitCommands;

EDIT: For this special purpose it should also work just by using the "setVehicleVarname" command. But you might meet a situation when scripting a multiplayer mission where you want the spawned vehicle to give functionalities available for everyone playing, not only being available on server side. Then you have to use the code above. Anyway, "setVehicleInit" is always your friend.

Edited by Bon

Share this post


Link to post
Share on other sites

Thank you for the explanation.

I tried setVehicleVarname in an alternative script and it wasn't working. After your answer i checked the script and i saw i made the damn typo error i often make, writing vehicule (as in french) instead of vehicle. :(

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
Sign in to follow this  

×