Jump to content
Sign in to follow this  
PhillyJoker

Global Variables & Movable Spawn Point Help [OPEN]

Recommended Posts

I thought someone on here might be interested in the struggle I've been through trying to get this work, and I feel like I am so close that perhaps there is something I'm just missing.

 

What I have so far is the following:

 

Got JIP working for the initial, but the disable script doesn't seem to apply to other players:
 
Added the following to initplayerlocal.sqf:
waituntil {! isnull player};
 
if (player == player) then 
{
 view = player addAction ["Settings", "scripts\Viewdistance.sqf", [],-98,false,false];
[] execVM "scripts\s3_tp_init.sqf";
} 
else {};
 
s3_tp_init.sqf:
_run = true;
 
while {_run} do
{
if(stopTeleport == "yes") then
{
_run = false;
};
if(player distance s3_teleport < 10) then
{
player setPos [(getPos s3_tf_spawn select 0)+((random 20)-10), (getPos s3_tf_spawn select 1)+((random 20)-10)];
};
sleep 5;
};
 
the Zeus player init contains:
stopTeleport = "no";
publicVariableServer "stopTeleport";
 
s3_spawn addAction ["Enable Teleport to Flag", "scripts\s3_tp_enable.sqf"];
_unit = _this select 1;
_run = true;
 
if(_unit iskindof "rhsusf_army_ocp_officer") then 
{
stopTeleport = "no";
publicVariableServer "stopTeleport";
while {_run} do
{
if(stopTeleport == "yes") then
{
_run = false;
Hint "";
};
if(player distance s3_teleport < 10) then
{
player setPos [(getPos s3_tf_spawn select 0)+((random 20)-10), (getPos s3_tf_spawn select 1)+((random 20)-10)];
};
Hint "Teleport Enabled";
sleep 3;
Hint "";
};
}
else {Hint "You are not in the Zeus Slot, Access Denied."};
 
s3_spawn addAction ["Disable Teleport to Flag", "scripts\s3_tp_disable.sqf"];
_unit = _this select 1;
 
if(_unit iskindof "rhsusf_army_ocp_officer") then 
{
stopTeleport = "yes";
publicVariableServer "stopTeleport";
Hint "Teleport Stopped";
sleep 10;
}
else {Hint "You are not in the Zeus Slot, Access Denied."};
 
So when the players join they will be teleported, but now it won't disable when i run the disable script. So for some reason the variable "stopTeleport" is not getting transferred or received by other players for some reason.

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  

×