UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Checking if the zone is active

broken avatar :(
Created 10 years ago
by niick555
0 Members and 1 Guest are viewing this topic.
1,935 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 9 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
All right? I'm doing a script here where I need to know when a player opens a door and activates a zone, but I can not at all... tried using the following modes, but it did not work... Any tips? Thank you!

Code Snippet
Plaintext
if( flag("enter_rua1_zone") == true ) { }

Code Snippet
Plaintext
if( level.zones["zone_name"].is_enabled == true ) { }

Code Snippet
Plaintext
if( level.zones["zone_name"].is_active == true ) { }
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
You can make your script waittill the zone is enabled.
Code Snippet
Plaintext
flag_wait( "enter_rua1_zone" );
// do whatever you want to do after it's activated
Marked as best answer by niick555 10 years ago
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 22 September 2013
Last active: 6 months ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
Personal Quote
Zombie Mapper and Gamer
Signature
My Custom Zombie Maps:

- Nazi zombie Legion
- City of Hell
- The Abandoned Mine
- The Last Undead House (Finished)

more custom zombie maps coming soon
×
gamer9294's Groups
Mapper Has released one or more maps to the UGX-Mods community.
gamer9294's Contact & Social Links
hi man,

I have made a simple script to check in which zone the player is, you can check which zone you want.

from the function out of the _zombiemode_zone_manager file it says also that the function will check if the zone is activated or not.






first open the script:    nazi_zombie_yourmapname.gsc

and scroll down untill you will see this:


Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();

add this under it:

Code Snippet
Plaintext
level thread check_players_in_zone();

it will look like this:

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();
level thread check_players_in_zone();


now the last step:


add this:

Code Snippet
Plaintext
check_players_in_zone()
{
wait 6;

zone_to_check = "start_zone"; // put here the name of the Zone that you want to check

while(1)
{
if(player_in_zone(zone_to_check))
{
iprintln("yes an player is in the zone: " + zone_to_check);
}
else
{
iprintln("no one is in that zone or the zone is not activated");
}

wait 1;
}
}

to the bottom of the script.


and you can edit this line to check which zone you want to check:

Code Snippet
Plaintext
zone_to_check = "start_zone"; // put here the name of the Zone that you want to check

just change the:   start_zone


I hope this will help you.


sorry for maybe bad english.



best regards,
- Gamer9294
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 9 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
hi man,

I have made a simple script to check in which zone the player is, you can check which zone you want.

from the function out of the _zombiemode_zone_manager file it says also that the function will check if the zone is activated or not.






first open the script:    nazi_zombie_yourmapname.gsc

and scroll down untill you will see this:


Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();

add this under it:

Code Snippet
Plaintext
level thread check_players_in_zone();

it will look like this:

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();
level thread check_players_in_zone();


now the last step:


add this:

Code Snippet
Plaintext
check_players_in_zone()
{
wait 6;

zone_to_check = "start_zone"; // put here the name of the Zone that you want to check

while(1)
{
if(player_in_zone(zone_to_check))
{
iprintln("yes an player is in the zone: " + zone_to_check);
}
else
{
iprintln("no one is in that zone or the zone is not activated");
}

wait 1;
}
}

to the bottom of the script.


and you can edit this line to check which zone you want to check:

Code Snippet
Plaintext
zone_to_check = "start_zone"; // put here the name of the Zone that you want to check

just change the:   start_zone


I hope this will help you.


sorry for maybe bad english.



best regards,
- Gamer9294

You can make your script waittill the zone is enabled.
Code Snippet
Plaintext
flag_wait( "enter_rua1_zone" );
// do whatever you want to do after it's activated

Thank you for the tips! They helped me a lot!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 22 September 2013
Last active: 6 months ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
Personal Quote
Zombie Mapper and Gamer
×
gamer9294's Groups
Mapper Has released one or more maps to the UGX-Mods community.
gamer9294's Contact & Social Links
Thank you for the tips! They helped me a lot!

You welcome ;)


Best regards,
- Gamer9294

 
Loading ...