AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Creating custom zones on map(s)? (https://forums.alliedmods.net/showthread.php?t=276829)

redivcram 12-28-2015 17:49

Creating custom zones on map(s)?
 
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?

FromTheFuture 12-28-2015 18:18

Re: Creating custom zones on map(s)?
 
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.

addicted2sex 12-28-2015 20:02

Re: Creating custom zones on map(s)?
 
Quote:

Originally Posted by redivcram (Post 2377444)
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

Phant 12-28-2015 21:47

Re: Creating custom zones on map(s)?
 
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:
http://6.firepic.org/6/images/2015-1...wqeuil2nex.gif


All times are GMT -4. The time now is 09:34.

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