Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
falconx1

Random Respawn based on Param help

Recommended Posts

Hi, I'm pretty new to scripting and I can't get my code to work. Note: it's for Coop multilayer.

How should i declare the variables for the random respawn and location etc? a player joining shouldn't have to execute the random code but only read the the var stored from the random code generated. I hope you understand me thanks for any help. :)

Parameters.hpp

class BaseLocation {
	title = "BASE Location";
	values[] = {1,2,3};
	texts[] = {"Random","North","South"};
	default = 1;
};

init.sqf

SelectedLocation = (paramsArray select 9);
if (isNil "SelectedLocation") then {SelectedLocation = 1};
execVM "new-init.sqf";

new-init.sqf

Randomize_Defend_Location = round ((random 3) + 0.5); 


_LocA = getMarkerPos "StartingLocation" + Randomize_Defend_Location;
_LocB = getMarkerPos "StartingLocation2";
_LocC = getMarkerPos "StartingLocation3";

switch (SelectedLocation) do
{
  case 1:{
  player setPos _LocA;

  };
     case 2:{
  player setPos _LocB;
  };

     case 3:{
  player setPos _LocC;
  };

};

Share this post


Link to post
Share on other sites
Sign in to follow this  

×