Jump to content
  • 0

Donator Trader City Access


ftshill

Question

So I have added / in the process of adding a donator trader city onto my epoch chernarus server.

 

Since I had gathered that creating a trader was very hard, instead i moved one of the boat traders, renamed it, added god mode to it, and am in the process of restocking it with different items.

 

This works fine, however, right now the only way i can see of restricting access to this trader is by setting the humanity needed to access it to something like 100 thousand (therefore preventing most normal players from having enough humanity to access it). I can then allocate donators with this humanity so they can access the trader. The issue with this now is that the donators would not have a choice of either hero or bandit. They would have to go with whichever is allocated to the trader.

 

Is it possible to create a different method of access restriction to the trader? E.g. only players with approved player UID's can access the trader? Or another method...

Any help setting this up would be awesome.

Link to comment
Share on other sites

Recommended Posts

  • 0

This did not work:

 

if (!((getPlayerUID player)in _donatorList)) then {
    (vehicle player) setPos [2811.9241, 4367.1597];
    cutText [format["%1 you are not allowed to enter this area!",name player],"PLAIN DOWN"];
    if((vehicle player) != player) then {
    (vehicle player) forceSpeed 0;
    sleep 2;
    (vehicle player) forceSpeed -1;
    };
};
 
so I am going to try:
 
if (!((getPlayerUID player)in _donatorList)) then {
    (vehicle player) setPos [2811.9241, 4367.1597];
    cutText [format["%1 This area is for Donators only!!",name player],"PLAIN DOWN"];
 if (vehicle player != player) then {
    vehicle player setVelocity[0, 0, 0];
   };
 
 
should there be a:
    };
};
 
at the end or just a:
};
Link to comment
Share on other sites

  • 0

oooo.. well you changed it. Neither of those wont work. Use this and don't change it.

_donatorList = ["123456789","123456789"];
_vehicle = vehicle player;

if (!((getPlayerUID player)in _donatorList)) then {
    _vehicle setPos [2811.9241, 4367.1597];
    cutText [format["%1 This area is for Donators only!",name player],"PLAIN DOWN"];
	if(_vehicle != player) then {
	_vehicle setVelocity[0, 0, 0];
    };
};
Link to comment
Share on other sites

  • 0

 

oooo.. well you changed it. Neither of those wont work. Use this and don't change it.

_donatorList = ["123456789","123456789"];
_vehicle = vehicle player;

if (!((getPlayerUID player)in _donatorList)) then {
    _vehicle setPos [2811.9241, 4367.1597];
    cutText [format["%1 This area is for Donators only!",name player],"PLAIN DOWN"];
	if(_vehicle != player) then {
	_vehicle setVelocity[0, 0, 0];
    };
};

This doesnt work at all. you can drive straight in....

Link to comment
Share on other sites

  • 0

Hows that even possible. It's the same code that worked before. There is just check if in vehicle, then set velocity added to it. I can't tell why it's not working without debuggin it. Maybe setPos and setVelocity overlapses. You could try small pause there.

_donatorList = ["123456789","123456789"];
_vehicle = vehicle player;

if (!((getPlayerUID player)in _donatorList)) then {
    _vehicle setPos [2811.9241, 4367.1597];
    cutText [format["%1 This area is for Donators only!",name player],"PLAIN DOWN"];
	if(_vehicle != player) then {
	sleep 1;
        _vehicle setVelocity[0, 0, 0];
    };
};
Link to comment
Share on other sites

  • 0

Thanks for all the help, everything is working now!

 

The vehicle speed is cut and the position is reset to the designated area!

 

I cannot thank you enough for all of your help with this topic! I am so relieved that this works, thank you Sukkaed!  :wub:

Link to comment
Share on other sites

  • 0

I have been trying to get this idea to work for a while now and I can get the script to teleport to run once, however if the player turns around and heads back in to the trader area, the script does not run again and they are allowed inside. I thought it was a problem with my sensor not repeating but I copied the sensor and placed a text message on it and I can step in and out of the sensor over and over and it just keeps repeating so now I think it may be a script issue. Any chance you could share your script to help me figure mine out?

 

Here is my donator teleport script, which works once....

 

_donatorList = ["12345678"];
_vehicle = vehicle player;

if (!((getPlayerUID player)in _donatorList)) then {
    _vehicle setVelocity[0, 0, 0];
    _vehicle setPos [2894.15,4403.62,0.001];
    cutText [format["%1 you are not allowed to enter the donator area!",name player],"PLAIN DOWN"];
};

 

And here is the sensor....

 

class Item5
        {
            position[]={2881.02,0.001,4544.47};
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="zonedonator";
            expCond="(player distance zonedonator) < 100;";
            expActiv="zonedonator = [] execVM ""scripts\donatortrader.sqf"";";
            expDesactiv="";
            class Effects
            {
      

Any help would be greatly appreciated.

Link to comment
Share on other sites

  • 0

If you use what i have used you should get it working fine, i can send you exactly what i used if you want.

 

Also, if you have the area where the player is teleported to too closde to the tp zone then the player can glitch back inside. it was an issue I was having until i got it fixed (e.g. move the location where the player is tp'd to further away from the tp zone).

 

Sukkaed, I am trying to add a feature where players with a certain amount of humanity do not get tp'd. Any ideas?

Link to comment
Share on other sites

  • 0
_donatorList = ["123456789","123456789"];
_vehicle = vehicle player;
_humanity = player getVariable ["humanity",0];

if (((getPlayerUID player)in _donatorList) or (_humanity > 5000)) then {
	cutText [format["Welcome %1!",name player],"PLAIN DOWN"];  
	} else {
	_vehicle setPos [2811.9241, 4367.1597];
        cutText [format["%1 This area is for Donators only!",name player],"PLAIN DOWN"];
	if(_vehicle != player) then {
	sleep 1;
	_vehicle setVelocity[0, 0, 0];
    };
};
Link to comment
Share on other sites

  • 0

So I moved the TP location out further from the sensor and it still only TPs me the first time I enter the area. Once I run back to the trader area it lets me all the way in to the trader. I am still not sure why it is doing this. I have the sensor set to repeat and I even tried the code posted just above by Sukkaed for the script but still no luck.

 

Any other ideas? I am pulling my hair out on this one.

 

Thanks

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...