AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   detect start defusing c4 stopped defusing c4 (https://forums.alliedmods.net/showthread.php?t=59032)

kp_uparrow 08-06-2007 22:30

detect start defusing c4 stopped defusing c4
 
how can i detect a person "stopped defusing c4"(let go of E and defusion process terminated)

Arkshine 08-06-2007 22:59

Re: detect start defusing c4 stopped defusing c4
 
Actually I don't know.

With amxx 1.8 which coming soon you may able to use ' cs_[g|s]et_c4_defusing(). '

EDIT :

I've found this VEN's tuto : http://forums.alliedmods.net/showthread.php?t=40164

I don't know if it can help you.

EDIT2 : You may able to use player data :
Quote:

#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
I don't know how use that. :p ( Maybe get_pdata_int( id, 193, 5 ) )

kp_uparrow 08-06-2007 23:21

Re: detect start defusing c4 stopped defusing c4
 
Bomb defusion (without kit) started event
register_logevent("logevent_function_p", 3, "2=Begin_Bomb_Defuse_Without_Kit")

// Bomb defusion (with kit) started event
register_logevent("logevent_function_p", 3, "2=Begin_Bomb_Defuse_With_Kit")



// Bomb planting/defusion canceled event
register_event("BarTime", "event_function", "b", "1=0")
// you must be sure that bomb planting/defusion is in progress!

i need these events, how would i detect the person stopped defusing with "BarTime"?

Note: there are other plugins in game that uses BarTime!

_Master_ 08-07-2007 02:43

Re: detect start defusing c4 stopped defusing c4
 
Upon defuse start BarTime is fired with the time (in seconds) it takes to "arm" the bomb. When done (break or arming sequence finished) the event is fired with "0". The BarTime event offers no info about the success of the action. You must use the logevent to check if it was successfull.

BarTime is however inaccurate as other plugins use this event to "delay" other actions. Bomb plant usually takes 5 seconds. If this event is "shared" then the other plugins musn't use the 5 sec flag in their actions. Thus all you have to do is check the time fired with the event as a delay of "5" would always mean a bomb planting. Still if you have doubts about it then is better you don't use this event.

kp_uparrow 08-07-2007 19:57

Re: detect start defusing c4 stopped defusing c4
 
how do i grab the id out of the bartime event?

_Master_ 08-08-2007 02:14

Re: detect start defusing c4 stopped defusing c4
 
register_event("BarTime", "BarTime_EventHandler", "be")
//
// ...
//

public BarTime_EventHandler(id)
{ // ...
}

kp_uparrow 08-08-2007 15:05

Re: detect start defusing c4 stopped defusing c4
 
the (id) would do? i though i needed to read data or something
thx

kp_uparrow 08-08-2007 15:27

Re: detect start defusing c4 stopped defusing c4
 
i just used public bomb_defusing ( defuser ){ and bartime event
bartime event somehow is called 2 times and also on bomb drop


All times are GMT -4. The time now is 07:59.

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