Jump to content
Sign in to follow this  
Ellman

Trigger that only allows specified UID's to enter (?)

Recommended Posts

Hello.

 

I've been searching forever (several months) for a script that allows me to setup a trigger and have it setup to a selected amount of Player UID/PID's.

And then if someone who is not on that list of ID's enters the area, then they get teleported outside the area. Pretty much to create a restricted area.

 

Hopefully someone on this forum knows how to do it or has a script that does it.

 

Thank you

Share this post


Link to post
Share on other sites
Guest

Hello.

 

I've been searching forever (several months) for a script that allows me to setup a trigger and have it setup to a selected amount of Player UID/PID's.

And then if someone who is not on that list of ID's enters the area, then they get teleported outside the area. Pretty much to create a restricted area.

 

Hopefully someone on this forum knows how to do it or has a script that does it.

 

Thank you

 

Setup a trigger and in activation you can put this : [] execVM isPlayerWhitelisted;

 

isPlayerWhitelisted.sqf

playerList = ["05848741784847777","SomeRandomUID"];

if (!(player in playerList)) then {
    player setPos getMarkerPos "MyMarker";
    // player setPos [15154,154841,64];
    // player setPos getPos _myobject;
}; 

Here you go, tell me if you need more explaination.

Share this post


Link to post
Share on other sites

I can't seem to get this to work

Here is what I have in the .sqf

playerList = [
	00000000000000000/* Assassin */,
	00000000000000000/* Kadaire */,
	00000000000000000/* Halvix */,
	00000000000000000/* Elikat */,
	00000000000000000/* BigSky */,
	00000000000000000/* Snakebite */,
	00000000000000000/* Grunt */
];

if (player in playerList) then {
    titleText ["Welcome Member!", "PLAIN"];   
}; 

if (!(player in playerList)) then {
	titleText ["This is a Members only area!", "BLACK OUT"];
	sleep 2;
	titleText ["You will now be teleported!", "BLACK IN"]; 
	sleep 2; 
	player setPos (getMarkerPos "locked_area_portal");
};

I also have tried using quotes around the uid list.

Here is what I have for activation.

null = thisList execVM "Assassin\map\lock.sqf";

I have tested it on a dedicated server and on single player

Share this post


Link to post
Share on other sites

Don't you have to use https://community.bistudio.com/wiki/getPlayerUID ?

 

like:

 

playerList = [
	00000000000000000/* Assassin */,
	00000000000000000/* Kadaire */,
	00000000000000000/* Halvix */,
	00000000000000000/* Elikat */,
	00000000000000000/* BigSky */,
	00000000000000000/* Snakebite */,
	00000000000000000/* Grunt */
];

_uid = getPlayerUID player;

if (_uid in playerList) then {
    titleText ["Welcome Member!", "PLAIN"];   
}; 

if (!(_uid in playerList)) then {
	titleText ["This is a Members only area!", "BLACK OUT"];
	sleep 2;
	titleText ["You will now be teleported!", "BLACK IN"]; 
	sleep 2; 
	player setPos (getMarkerPos "locked_area_portal");
};

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
4 minutes ago, celludriel said:

Don't you have to use https://community.bistudio.com/wiki/getPlayerUID ?

 

like:

 


playerList = [
	00000000000000000/* Assassin */,
	00000000000000000/* Kadaire */,
	00000000000000000/* Halvix */,
	00000000000000000/* Elikat */,
	00000000000000000/* BigSky */,
	00000000000000000/* Snakebite */,
	00000000000000000/* Grunt */
];

_uid = getPlayerUID player;

if (_uid in playerList) then {
    titleText ["Welcome Member!", "PLAIN"];   
}; 

if (!(_uid in playerList)) then {
	titleText ["This is a Members only area!", "BLACK OUT"];
	sleep 2;
	titleText ["You will now be teleported!", "BLACK IN"]; 
	sleep 2; 
	player setPos (getMarkerPos "locked_area_portal");
};

 

And it works! Thanks boss, been stumped for a good hour or two. 

Still getting back into the scripting. . . . .

  • Like 1

Share this post


Link to post
Share on other sites

Your welcome, sometimes the answer stares you in the face, been there done that , glad I could help enjoy your scripting adventure

Share this post


Link to post
Share on other sites
Just now, killzone_kid said:

 

UIDs in the list should be in quotes

Roger that, I know that "getPlayerUID player" doesn't work in single player so I used _uid = 000000000000000 instead.

Thanks for the help man. 

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  

×