Jump to content
  • 0

Quick and simple "starter crate"


boxman80

Question

Recommended Posts

  • 0

Going back to the starter box (sorry! :D )...

Is there a way to:
1: Only allow one box per restart of the server?

2: Kill any players who attempt to access the box who aren't authorized to do so.

 

I'm currently Googling for terms like "ArmA scripting counter, count, count if" etc but not making much progress.

Link to comment
Share on other sites

  • 0

"ArmA scripting counter"? what should that be a counter is a simple variable you count up or what :D

counter = counter + 1;

there you have a counter :D

 

about killing players who access the box, should be possble if intercept the gear event (gear thing is always display 106 I think) but I don't know if you can see if that is the gear from the box or any other vehicle/player tha easily :D

 

you always come up with such complicated script ideas, maybe start with something simple to learn it first? :)

Link to comment
Share on other sites

  • 0

I was about to test this, but our server is down :-P

if ((getPlayerUID player) in ["########"]) then { // list of admin UID's who can use the script
	if (_canDo && (speed player <= 1)) then 
	{
		boxCounter;
		if (s_player_donorBox < 0 && (boxCounter < 1)) then 
		{
			sleep 5;
			s_player_donorBox = player addaction [("<t color=""#007ab7"">" + ("Donor Box") +"</t>"),"Scripts\donorBox.sqf","",5,false,true,"",""];
			boxCounter = boxCounter + 1;
		};
	} else 
	{
		player removeAction s_player_donorBox;
		s_player_donorBox = -1;
		cutText [format["Only 1 box per restart."], "PLAIN DOWN"];
	};
};

Probably won't work but worth a shot.

Edited by DY357LX
Link to comment
Share on other sites

  • 0

I don't really see the point why admins should be restricted like that? :P

also if the admins relog all variables get reset (your boxCounter is only player local so everything you do is removed after a player logs out).

 

anyway to initialize the variable, instead of "boxCounter; use something like

if (isNil "boxCounter") then {
    boxCounter = 0;
};
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
  • Advertisement
  • Discord

×
×
  • Create New...