Raised This Month: $ Target: $400
 0% 

Creating custom zones on map(s)?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-28-2015 , 17:49   Creating custom zones on map(s)?
Reply With Quote #1

Is this possible? How? For example you have a jailbreak map and want to place a custom zone named "Gunroom" for example, then put it inside the room of the map called gun room, Then a function gets called from another code and it checks if a player is inside that zone, if so then do something. How can I make something like that?
redivcram is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 12-28-2015 , 18:18   Re: Creating custom zones on map(s)?
Reply With Quote #2

U must create a entity, then set classname (gunroom), solid (solid_trigger) and size (zone radius). After, U can hook touch player with this entity.
FromTheFuture is offline
addicted2sex
Senior Member
Join Date: May 2009
Location: localhost
Old 12-28-2015 , 20:02   Re: Creating custom zones on map(s)?
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
Is this possible? How? For example you have a jailbreak map and want to place a custom zone named "Gunroom" for example, then put it inside the room of the map called gun room, Then a function gets called from another code and it checks if a player is inside that zone, if so then do something. How can I make something like that?
Have a look at model's WalkGuard for example code
__________________
Let 7he gr0ovE r3Lease y0ur m!nd
addicted2sex is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 12-28-2015 , 21:47   Re: Creating custom zones on map(s)?
Reply With Quote #4

You should create trigger trigger_multiple with specific name. See WalkGuard for example.
Then:
PHP Code:
register_touch("trigger_multiple""player""FwdPlayerTouchTriggerMultiple"
:
PHP Code:
public FwdPlayerTouchTriggerMultiple(entityid)
{
       if(
is_user_alive(id))
       {
             new 
name[13]
             
pev(entitypev_targetnamenamecharsmax(name))
             if(
equali(name"nofalldamage"))
             {
       
entity_set_int(idEV_INT_watertype, -3)
     }
       }

In this example Player can fall down without any damage (like on water) when fall down inside trigger:
Phant is offline
Send a message via ICQ to Phant
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode