Jump to content
Sign in to follow this  
7Cav1Clip

Player UID trigger

Recommended Posts

A trigger to call UID array. If its a match they can get in trigger area, if not something happens. Currently kills them, eventually just move them to X location. Works with just me and I change the UID in the array but not working once others join.

uid = getPlayerUID player; if (uid in masterUIDArray) then {hint "Your good"} else { if (uid != masterUIDArray)} then {_x setdamage 1} foreach(_this select 1);

Any ideas?

Share this post


Link to post
Share on other sites

You seemed to be missing a } before the foreach part in your line, anywho somthing like this is what i would do:

Problem is that triggers activate once someone is inside, but then will not activate if a second unit comes inside after activation.

i would solve that by running a script from the trigger, wich is basically the same as trigger wait.

place in init.sqf:

allowedArea = true;

trigger is set to repeated, 1 second delay, anyone present and condition of trigger is:

({isPlayer _x AND !((getPlayerUID _x) in masterUIDArray[b])[/b]} count thisList) != 0 AND allowedArea

place in on act of trigger:

allowedArea = false;
{
if (isPlayer _x AND !((getPlayerUID _x) in masterUIDArray)) then {_x setDammage 1};
} foreach (list thisTrigger);

place this in on deact:

allowedArea = true;

Edited by Demonized
missing )

Share this post


Link to post
Share on other sites

Hrmm, well sort of works. When I walk in, I am fine. When someone else walks in kills everyone including those on the list

Share this post


Link to post
Share on other sites
Hrmm, well sort of works. When I walk in, I am fine. When someone else walks in kills everyone including those on the list

lol im an idiot: remove the player setDammage 1 from the on act part, it should have been deleted before posting but i missed it

previous post updated, it was a old part wich was replaced by the if () then {setDammage part.

forgot to delete it.

Edited by Demonized

Share this post


Link to post
Share on other sites

This trigger is a great starting point for what im looking for...I need a trigger that will move a unit instead of killing it. I already have teleport scripts on my dedi i wonder if it can be mod to fit this request.

The current teleport script I am using is saved as an sqf file and its called by an action on the object init.

//tele.sqf

//to teleport player to marker truman

_tele = this select 0;

_caller = _this select 1;

_caller setPos (getPos (truman));

hint "Welcome to Truman Air Station";

EDIT AFTER POSTING

A few minutes after posting this I was able to change the parameters to teleport a unit. The acc script should be mod to look like this:

allowedArea = false; { if (isPlayer _x AND !((getPlayerUID _x) in masterUIDArray)) then {_x setPos (getPos (cadet));}; } foreach (list thisTrigger);

where it says (cadet) you would change to what ever your object reads. Can be named anything you like.

Edited by shadesb181
Updated the script

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  

×