Raised This Month: $ Target: $400
 0% 

Detect C4 creation/spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-23-2008 , 15:43   Detect C4 creation/spawn
Reply With Quote #1

Does someone know how to detect c4 creation (not weapon_c4, planted c4 that has classname "grenade") ?
I don't want to hook FM_SetModel and i don't want to retrieve c4 index when logevent/sound/textmsg is fired.
Ham_Spawn ("grenade") doesn't detect it, FM_CreateNamedEntity is not fired.
FM_CreateEntity is fired but well, entity is not valid yet.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-23-2008 at 15:51.
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-23-2008 , 15:47   Re: Detect C4 creation/spawn
Reply With Quote #2

What do you mean by creation?
When it is first created when the map starts?
When it is given to the player at round start?
When it is planted on the ground?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-23-2008 , 15:51   Re: Detect C4 creation/spawn
Reply With Quote #3

Quote:
Originally Posted by 'Exolent[jNr
When it is planted on the ground?
This one, post updated.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-23-2008 , 16:25   Re: Detect C4 creation/spawn
Reply With Quote #4

Have you tried FM_Spawn?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-23-2008 , 17:45   Re: Detect C4 creation/spawn
Reply With Quote #5

Sure.

Also, Ham_Item_Kill ("weapon_c4") is fired even after the c4 model has been set.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-23-2008 , 18:07   Re: Detect C4 creation/spawn
Reply With Quote #6

Did FM_Spawn work or not? I couldn't tell from "sure".
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-23-2008 , 18:15   Re: Detect C4 creation/spawn
Reply With Quote #7

No.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-23-2008 , 18:25   Re: Detect C4 creation/spawn
Reply With Quote #8

After doing some testing, FM_SetModel was the best method that I used.
Why don't you want to use FM_SetModel?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-23-2008 , 18:51   Re: Detect C4 creation/spawn
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
After doing some testing, FM_SetModel was the best method that I used.
Why don't you want to use FM_SetModel?
Probably cause it's called very often, but I see no other way of doing this. Maybe a Ham version of SetModel only for the proper entity class would reduce the possible overhead, but I couldn't find it in ham_const.inc.
__________________

Community / No support through PM
danielkza is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-24-2008 , 03:09   Re: Detect C4 creation/spawn
Reply With Quote #10

Quote:
Originally Posted by danielkza View Post
Probably cause it's called very often
Exactly.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 09:06.


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