This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

User is planting the bomb?


Post New Thread Reply   
 
Thread Tools Display Modes
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 11-29-2006 , 23:32   Re: User is planting the bomb?
Reply With Quote #11

Quote:
Originally Posted by dutchmeat View Post
meh slaps myself in face, but asks if this could be right ?

Code:
public bomb_planting( planter ) { return PLUGIN_HANDLED }
That's what I use.

Specifically, in one of my plugins, I detect the starting and stopping of the bomb being planted thusly:

Code:
public bomb_planting(planter) {     g_bombPlanter = planter;     meter_pause(planter); } public event_bartime(id) {     if (read_data(1) == 0)     {         if (id == g_bombPlanter)             g_bombPlanter = 0;         else if (id == g_bombDefuser)             g_bombDefuser = 0;         else             return;                     meter_unpause(id);     } } public bomb_planted(planter) {     g_bombPlanter = 0;     g_bombPlanted = true;     meter_unpause(planter); }
__________________
Brad is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-29-2006 , 23:44   Re: User is planting the bomb?
Reply With Quote #12

So, yes, it is sent a second time then?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 11-29-2006 , 23:48   Re: User is planting the bomb?
Reply With Quote #13

The "BarTime" event, yes.
__________________
Brad is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 23:50   Re: User is planting the bomb?
Reply With Quote #14

I never knew such a forward existed, I feel so lonely...
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-30-2006 , 11:39   Re: User is planting the bomb?
Reply With Quote #15

Quote:
You could use the good old method of hooking attack (buttons) through prethink and check their current weapon
Player can press attack outside of bomb target so you have to check if player at the bomb target, if CurWeapon is C4, if in attack button, if old buttons not in attack. But even this will not tell you for sure. Player can be in the air. Et cetera.

Even if button is pressed this doesn't necessarily mean that the corresponding action occurs. So i can't agree that this method is "good", old - yes, but not that good.


Quote:
Only problem is that other 3rd prarty plugins can also invoke the progress bar.
In fact everything can be faked: messages, entities, models, animation, etc, so you can't be sure in any way.

But we don't care unless they use emessage system.
FYI: Even bomb_planting forward is use BarTime to catch bomb planting also, so emessage will mess with this forward also.
Basically the functionality of this forward is the same as hook
Code:
register_event("BarTime", "evBombPlantingStarted", "be", "1=3")
So we do not actually need an additional module in this case.


Quote:
Check the player's animation
This method isn't accurate enough.


Quote:
Catch when the bar is displayed on the screen - my only concern here is what if the player didn't complete planting it - I would have to reset the isPlayerPlanting variable - how do do this?
As shown in the Brad's code you have to check whether the first argument of BarTime message equal to zero.

Also here are the CS Bomb Scripting FAQ/Tutorial
VEN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-01-2006 , 02:25   Re: User is planting the bomb?
Reply With Quote #16

TY for that link VEN - so in theory I could just use these 2 :

// Bomb planting started event
register_event("BarTime", "event_function", "be", "1=3")

// Bomb planting/defusion canceled event
register_event("BarTime", "event_function", "b", "1=0")

and have a boolean variable
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
VEN
Veteran Member
Join Date: Jan 2005
Old 12-01-2006 , 05:53   Re: User is planting the bomb?
Reply With Quote #17

Yes, but since the second one isn't called on bomb plant you'll have to hook bomb_planted event as well.

Quote:
// Bomb planted event
register_logevent("logevent_function_p", 3, "2=Planted_The_Bomb")
VEN 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 02:32.


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