Jump to content
Sign in to follow this  
hogmason

Paradrop timer

Recommended Posts

ve found this old sqs halo script witch works ok but i need a 20 min time limit between jumps would any 1 know how do this

called by flag pole with this in init

this addaction ["(Hardcore Paradrop)","HOG scripts\Halo.sqs"];

Halo.sqs

_first = _this select 0
_text = "To Lazy to walk!!! well single left click on the map to mark drop position and hold on for a =HARDCORE= paraDrop..."
?(format["%1",_first] == "Again"): 
TitleText [_text,"Plain"]
;forceMap true
#Marker_1
onMapSingleClick "_StartLocation = player setPos _pos;[_StartLocation] exec ""HOG scripts\Halo1.sqs"";onMapSingleClick """""
;
exit

Halo1.sqs

[Player,1700]exec "ca\air2\halo\data\Scripts\HALO_init.sqs"
exitWith

so would any 1 know how to place a 20 minute time limit in there where the player has to wait between jumps

Share this post


Link to post
Share on other sites

Without going into detail - maybe this will help you in the right direction...

you could use a global variable in the above script - if false, it allows you to jump if true- you have to wait out the timer till its false.

the player would be calling it so you wouldnt pv it as that would affect everyone.

halotimer.sqf

halo_active = true; 
_timer = 360;
while {_timer != 0} do 
 	{

  _text = hintSilent format["Halo unavailable - Wait %1 seconds",_timer];
   _timer = _timer - 1;
   sleep 1;

};
hint "Halo available";
     halo_active = false;

if (halo_active == false) then 
{
sqf stuff here..
execVM "halotimer.sqf";
} else

{
hint " you will have to wait for it to be available.";
};

bit rushed bit should give you an idea at least

Share this post


Link to post
Share on other sites

Oh, a global variable... I been searching for something like that for some time now, never thought of a global variable, as it affects each player individually. Thanks buddy, got a whole new world in front of me!

Share this post


Link to post
Share on other sites

awsome thanks mate really appreciate that.

---------- Post added at 10:50 ---------- Previous post was at 10:35 ----------

awsome thanks mate really appreciate that.

Share this post


Link to post
Share on other sites

Mikie boy, i played with that all day mate and googled global variables but i just can not get it to work this is what i done.

flagpoleHALO.sqf

if (halo_active == false) then {

haloed = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos _pos; [player, 2000] exec 'ca\air2\halo\data\Scripts\HALO_init.sqs';haloed = false;hint 'Close the map and don''t forget to open your chute!'";
waitUntil{!haloed};
onMapSingleClick "";
execVM "halotimer.sqf";
}; else {

hint " you will have to wait for it to be available.";

};

"halotimer.sqf

halo_active = true; 
_timer = 360;
while {_timer != 0} do 
 	{

  _text = hintSilent format["Halo unavailable - Wait %1 seconds",_timer];
   _timer = _timer - 1;
   sleep 1;

};
hint "Halo available";

just can not get it :(

Share this post


Link to post
Share on other sites

Maybe something like this mate....

if (not Halo_Active) then {
Haloed = false;
Halo_Active = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos _pos; [player, 2000] exec 'ca\air2\halo\data\Scripts\HALO_init.sqs';Haloed = true;hint 'Close the map and don''t forget to open your chute!'";
waitUntil {Haloed};
onMapSingleClick "";
_wait = time + 360;
waitUntil {time > _wait};
Halo_Active = false;
} else {
hint " you will have to wait for it to be available.";
};

Edited by twirly
Correcte error

Share this post


Link to post
Share on other sites

thanks twirly but nothing is happening with that one.

---------- Post added at 17:03 ---------- Previous post was at 16:53 ----------

Ok so this works but the timer comes up saying wait for blah blah with a count down timer but you can still click on the map and halo drop.

in flag

this addAction["HALO","flagpoleHALO.sqs"];

flagpoleHALO.sqs

if (halo_active == false) then 
{
_first = _this select 0
_text = "To Lazy to walk!!! well single left click on the map to mark drop position and hold on for a =HARDCORE= paraDrop..."
?(format["%1",_first] == "Again"): 
TitleText [_text,"Plain"]
;forceMap true
#Marker_1
onMapSingleClick "_StartLocation = player setPos _pos;[_StartLocation] exec ""Halo1.sqs"";onMapSingleClick """"";
execVM "halotimer.sqf";
} else

{
hint " you will have to wait for it to be available.";
};

Halo1.sqs

[Player,1700]exec "ca\air2\halo\data\Scripts\HALO_init.sqs"
exitWith

halotimer.sqf

halo_active = true; 
_timer = 360;
while {_timer != 0} do 
 	{

  _text = hintSilent format["Halo unavailable - Wait %1 seconds",_timer];
   _timer = _timer - 1;
   sleep 1;

};
hint "Halo available";
     halo_active = false;

Any ideas would it be the fact that the halo timer is sqf and the flagpoleHALO is sqf

Edited by hogmason
spelling mistake in script

Share this post


Link to post
Share on other sites

man your an absalute legend thanks mate if you lived near id shout you a carton ;):yay:

Share this post


Link to post
Share on other sites
man your an absalute legend thanks mate if you lived near id shout you a carton ;):yay:

No worries man.... here's another version that'll tell you how many seconds left when try to execute the action on the flagpole again. Should automatically open and close the map for you as well.

if (not Halo_Active) then {
Haloed = false;
Halo_Active = true;
Halo_Wait = 60;
hintSilent "Click on the map where you'd like to HALO.";
openMap [true,false];
onMapSingleClick "player setPos _pos; [player, 1000] exec 'ca\air2\halo\data\Scripts\HALO_init.sqs';Haloed = true;hint 'Don''t forget to open your chute!'";
waitUntil {Haloed};
onMapSingleClick "";
openMap [false,false];
while {Halo_Wait > 0} do {
	Halo_Wait = Halo_Wait - 1;
	sleep 1;
};
Halo_Active = false;
} else {
hint format ["You will have to wait %1 seconds for it to be available!!",Halo_Wait];
};

Share this post


Link to post
Share on other sites

twirly got a question for you mate ive added a Altimeter script so you know how high you are but i just cant seem to get it to execute

i tried

Para.sqf

if (not Halo_Active) then {
Haloed = false;
Halo_Active = true;
Halo_Wait = 60;
hintSilent "Click on the map where you'd like to HALO.";
openMap [true,false];
onMapSingleClick "player setPos _pos; [player, 1000] exec 'ca\air2\halo\data\Scripts\HALO_init.sqs';Haloed = true;hint 'Don''t forget to open your chute!'";
waitUntil {Haloed};
onMapSingleClick "";
openMap [false,false];
       nul = [] execVM "HOG scripts\Altimeter.sqf"; //[color="#FF0000"]this is what i added to execute it. doesnt fire thought[/color]
while {Halo_Wait > 0} do {
	Halo_Wait = Halo_Wait - 1;
	sleep 1;
};
Halo_Active = false;
} else {
hint format ["You will have to wait %1 seconds for it to be available!!",Halo_Wait];
};

Altimeter.sqf

while {((getposATL player)select 2) > 1} do
{
hintsilent format ["Altimeter: %1", round (getPosATL player select 2)];
};
if (((getposATL player)select 2) < 1) then
{
hintsilent "";
};

Dont supose you know the solution mate.

Share this post


Link to post
Share on other sites

The script itself should work... I did shorten it a little. I think you also need to remove any spaces in your folder name. So "HOG Scripts" should be "HOG_Scripts" or similar.... without spaces.

Also... I added a 1 second sleep so the hint updates once a second instead of constantly. You can reduce this time if you want... but at least the while isn't executing every frame. Less stress on the system.

nul = [] execVM "[b][i]HOG_scripts[/i][/b]\Altimeter.sqf"; //this is what i added to execute it. doesnt fire thought

and...

while {((getposATL player)select 2) > 1} do {
hintsilent format ["Altimeter: %1", round (getPosATL player select 2)];
[b][i]sleep 1[/i][/b];
};

hintsilent "";

See how you go mate.

Share this post


Link to post
Share on other sites

thanks twirly that works but a strange thing is happening ill test the mission and i get the altimeter then ill quite then go to test again and it works then quit then try test again and then no altimeter the only way to get it back seems to be to copy and past the altimeter script in again.

Pretty strange hey. it wouldnt be were i am placing the

nul = [] execVM "HOG_scripts\Altimeter.sqf";

line in the paradrop script would it.

Share this post


Link to post
Share on other sites

Don't think that's the problem man. Might have something to do with the Halo_Wait or Halo_Active. That's the first thing I would be checking. Make sure the logic is sound.

Don't have time now.... but will run through the whole thing later for you (if you don't fix it first!).

Share this post


Link to post
Share on other sites

It works for me mate.... I just added a line to Altimeter.sqf to waituntil the player was actually in the air.

altimeter.sqf:-

[b]waituntil {((getposATL player)select 2) > 1};[/b]

while {((getposATL player)select 2) > 1} do {
hintsilent format ["Altimeter: %1", round (getPosATL player select 2)];
sleep 0.1;
};

hintsilent "";

Share this post


Link to post
Share on other sites

thanks man thats one thing i diddnt think off ;)

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  

×