Raised This Month: $ Target: $400
 0% 

func_bomb_target


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
njee
Junior Member
Join Date: Nov 2010
Old 11-16-2010 , 13:30   func_bomb_target
Reply With Quote #1

how to catch an event when a player is in the area func_bomb_target ?
njee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-16-2010 , 13:32   Re: func_bomb_target
Reply With Quote #2

For all players or only for c4 carrier ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
njee
Junior Member
Join Date: Nov 2010
Old 11-16-2010 , 13:34   Re: func_bomb_target
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
For all players or only for c4 carrier ?
if not complicate both examples... If a player performs an action in the area
njee is offline
Old 11-16-2010, 14:04
njee
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-16-2010 , 16:25   Re: func_bomb_target
Reply With Quote #5

Catch the event you want and check if cs_get_user_mapzones for the player has the corresponding bit for bomb target.
Code:
#define CS_MAPZONE_BUY 			(1<<0)
#define CS_MAPZONE_BOMBTARGET 		(1<<1)
#define CS_MAPZONE_HOSTAGE_RESCUE 	(1<<2)
#define CS_MAPZONE_ESCAPE		(1<<3)
#define CS_MAPZONE_VIP_SAFETY 		(1<<4)

/* Returns in bitwise form if the user is in a specific map zone.
 * NOTE: If user can't plant (cs_get_user_plant(index) is 0) then cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET will return 0 too.
 */
native cs_get_user_mapzones(index);
However, looking at the NOTE, it seems you would be able to just check cs_get_user_plant.

If you need to know for a player without the ability to plant, you could attempt to find the bounds of the bomb target's entity (pev_mins and pev_maxs) and check if the player is within that space.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
njee
Junior Member
Join Date: Nov 2010
Old 11-17-2010 , 02:06   Re: func_bomb_target
Reply With Quote #6

Quote:
Originally Posted by Emp` View Post
Catch the event you want and check if cs_get_user_mapzones for the player has the corresponding bit for bomb target.
Code:
#define CS_MAPZONE_BUY 			(1<<0)
#define CS_MAPZONE_BOMBTARGET 		(1<<1)
#define CS_MAPZONE_HOSTAGE_RESCUE 	(1<<2)
#define CS_MAPZONE_ESCAPE		(1<<3)
#define CS_MAPZONE_VIP_SAFETY 		(1<<4)

/* Returns in bitwise form if the user is in a specific map zone.
 * NOTE: If user can't plant (cs_get_user_plant(index) is 0) then cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET will return 0 too.
 */
native cs_get_user_mapzones(index);
However, looking at the NOTE, it seems you would be able to just check cs_get_user_plant.

If you need to know for a player without the ability to plant, you could attempt to find the bounds of the bomb target's entity (pev_mins and pev_maxs) and check if the player is within that space.
can be an example, please
njee is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 11-17-2010 , 02:52   Re: func_bomb_target
Reply With Quote #7

You can make a stock or macro for it:
Code:
stock is_user_in_plant_zone( id ) {     return (cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET) } // Or a macro will be more effecient #define is_user_in_plant_zone(%1) (cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET)
Usage:
Code:
public some_function( id ) {     if ( is_user_in_plant_zone( id ) )         client_print( id, print_chat, "What r u waiting for ?? Plant the Bomb !!" ) }
But it would be better if you check whether the user is in the plant zone by using emps' method ( Checking min's and max's )
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
njee
Junior Member
Join Date: Nov 2010
Old 11-17-2010 , 03:06   Re: func_bomb_target
Reply With Quote #8

Quote:
Originally Posted by abdul-rehman View Post
You can make a stock or macro for it:
Code:
stock is_user_in_plant_zone( id ) {     return (cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET) } // Or a macro will be more effecient #define is_user_in_plant_zone(%1) (cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET)
Usage:
Code:
public some_function( id ) {     if ( is_user_in_plant_zone( id ) )         client_print( id, print_chat, "What r u waiting for ?? Plant the Bomb !!" ) }
But it would be better if you check whether the user is in the plant zone by using emps' method ( Checking min's and max's )
thanks guys! karma
njee is offline
Old 11-17-2010, 22:20
nmjv367
This message has been deleted by Exolent[jNr]. Reason: Spambot
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 11:29.


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