TheNightstalk3r 6 Posted May 23, 2016 Hi guys, I've been trying to create a restricted area for the past few days. I put a trigger that covers my base that launches a custom script when activated (http://pastebin.com/Q2MsZW4c). The point of this trigger is to let clan members in, but kill others that still wander the base after 10 seconds. It seems to works great except for the following case: I entered the base, I did not get killed because my Player UID is in the PIDArray. However a stranger that had joined got killed after 10 seconds when I entered the restricted area. Is there a way to let the trigger only check the player uid for the one that entered the restricted area and leave the other players alone? Also, is it possible to leave the script checking the uids continuously (so also when a second player enters the restricted area and there already is a clan member in the same area). I simply don't seem to be able to get it to work. Hope you guys can help me out! Kind regards, The_Nightstalk3r 160th Joint Special Forces Aviation Regiment Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 23, 2016 Hi guys, I've been trying to create a restricted area for the past few days. I put a trigger that covers my base that launches a custom script when activated (http://pastebin.com/Q2MsZW4c). The point of this trigger is to let clan members in, but kill others that still wander the base after 10 seconds. It seems to works great except for the following case: I entered the base, I did not get killed because my Player UID is in the PIDArray. However a stranger that had joined got killed after 10 seconds when I entered the restricted area. Is there a way to let the trigger only check the player uid for the one that entered the restricted area and leave the other players alone? Also, is it possible to leave the script checking the uids continuously (so also when a second player enters the restricted area and there already is a clan member in the same area). I simply don't seem to be able to get it to work. Hope you guys can help me out! Kind regards, The_Nightstalk3r 160th Joint Special Forces Aviation Regiment So after some more scripting, I got the trigger to stop killing everyone on the server. However I've ran into a new problem. Since the trigger activates when one person comes in, and thus ignores a second one coming in, it seems impossible to disable the "killzone" unless you guys know a way to delete a trigger and later restore it? Or is it possible to accurately code it in my scripts (http://pastebin.com/jauB6N8n). Summary of the problem: a second individual entering will still be killed bythe trigger because for his instance Status is still 1 when the first player has used the "Disable Killzone" option. Also for the first person, both addaction disappear after disabling the killzone. Help would be appreciated! Kind regards, The_Nightstalk3r 160th Joint Special Forces Aviation Regiment Share this post Link to post Share on other sites
davidoss 550 Posted May 23, 2016 Since the trigger activates when one person comes in, and thus ignores a second one coming in, it seems impossible to disable the "killzone" unless you guys know a way to delete a trigger and later restore it? There are beter two ways to achieve this. Use Heeeere's johnny's! Trigger List Changed or create local trigger on each player. Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 There are beter two ways to achieve this. Use Heeeere's johnny's! Trigger List Changed or create local trigger on each player. I've looked through the coding and your suggestion. How would I create those trigger locally for each player on a marker (e.g "Baseplate") but keep the Status variable broadcasted globally? Also check the pastebin from my 2nd post if you need to know how it's scripted so far Share this post Link to post Share on other sites
doomnet 23 Posted May 24, 2016 Hi don't know if it helps but i used this in the past: VipBase.sqf if ((getPlayerUID player) in ["UID's of players"]) then { titleText ["Hello Vip Player. Welcome back.", "PLAIN DOWN", 3]; } else { titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3]; sleep 5; titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3]; sleep 10; titleText ["You were warned..!", "PLAIN DOWN", 3]; sleep 5; player setDamage 1; }; trigger settings trigger on repeat present anybody or your side condition field : Player in thislist activation field: null = [this] execVM "scriptsVipBase.sqf"; this is a simple workaround and works pretty good ! Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 Hi don't know if it helps but i used this in the past: VipBase.sqf if ((getPlayerUID player) in ["UID's of players"]) then { titleText ["Hello Vip Player. Welcome back.", "PLAIN DOWN", 3]; } else { titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3]; sleep 5; titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3]; sleep 10; titleText ["You were warned..!", "PLAIN DOWN", 3]; sleep 5; player setDamage 1; }; trigger settings trigger on repeat present anybody or your side condition field : Player in thislist activation field: null = [this] execVM "scriptsVipBase.sqf"; this is a simple workaround and works pretty good ! What you wrote is almost exactly what I've written in my own mission Share this post Link to post Share on other sites
doomnet 23 Posted May 24, 2016 Yes probably your script is not working as it should, also its not clear what you really ask for the script i provide will always work even with clan members in the area, and will always check uid of players even with or without clan or normal players in the area so what's the point ? maybe explain it better because its confusing ! i think you take the problem upside down! why not making a secret respawn area for your clan members with reserved slots ? Share this post Link to post Share on other sites
mrcurry 478 Posted May 24, 2016 Triggers execute locally only. Just use a trigger condition that is local as well: player in thisList That way the trigger will only fire for the player who enters it. Also my 2 cents on area restriction is "move not kill" a.k.a. I prefer teleporting ppl away. Killing is one, very harsh and two might mess with any loadouts they have. Teleporting also makes the mission more friendly in its attitude and might help recruitment. Just some food for thought. 1 Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 Yes probably your script is not working as it should, also its not clear what you really ask for the script i provide will always work even with clan members in the area, and will always check uid of players even with or without clan or normal players in the area so what's the point ? maybe explain it better because its confusing ! i think you take the problem upside down! why not making a secret respawn area for your clan members with reserved slots ? The point is that when the kill zone is disabled, it's not for people who enter the kill zone afterwards. As in the script problem, Status is only set to 0 locally, not globally, which is the whole point of the kill zone. A clan member walks into the zone, uses "disable all killzones", then the killzones should be disabled. However with the current state of it, guests will still be killed (likely because the "Status" is not changed globally) Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 Triggers execute locally only. Just use a trigger condition that is local as well: player in thisList That way the trigger will only fire for the player who enters it. Also my 2 cents on area restriction is "move not kill" a.k.a. I prefer teleporting ppl away. Killing is one, very harsh and two might mess with any loadouts they have. Teleporting also makes the mission more friendly in its attitude and might help recruitment. Just some food for thought. This is implemented on my unit Operation server. The Base contains vehicles that guests keep stealing even during operation times because these are generally higher powered than those available to the guests. They are given 3 warnings in 15 seconds. If by that time people don't get they are not allowed to be in there, they will know after they die once. If they continue to walk in I can't be bothered taking a lighter punishment for it Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 It might be easier to overcome this by splitting the functions from the trigger. For example the kill zone remains connected to the trigger, but the disable and enable script is launched as an addaction for a laptop or a data terminal? Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 24, 2016 It might be easier to overcome this by splitting the functions from the trigger. For example the kill zone remains connected to the trigger, but the disable and enable script is launched as an addaction for a laptop or a data terminal? Okay so I got almost everything working. Only thing is that the Status for the trigger is not updated globally, so if I disable the killzone (Status = 0), guests still get the warning messages. http://pastebin.com/7rcfWTW4Do you see anything that might be causing it not to work? Or if you have got a work-around please let me know! Share this post Link to post Share on other sites
KevsNoTrev 44 Posted May 24, 2016 Have you tried to publicvariable the value for status? Share this post Link to post Share on other sites
TheNightstalk3r 6 Posted May 25, 2016 Have you tried to publicvariable the value for status? Yes I have the status declared as publicVariable in init.sqf. Maybe it should be declared in initserver.sqf since it shouldn't be local? Share this post Link to post Share on other sites