Re: [FAQ/Tutorial] CS Bomb Scripting
Another way for checking if a player has c4 is:
PHP Code:
To get the planted C4 entity index(grenade) a direct way would be to hook CGrenade::ShootSatchelCharge with okapi(orpheu can't hook it because it doesn't support vector class). PHP Code:
PHP Code:
If you want to detect when a user stop planting, you need to register BarTime event but also Ham_Item_Holster to prevent it being innacurate due to weapon switch. |
Re: [FAQ/Tutorial] CS Bomb Scripting
Quote:
Quote:
|
Re: [FAQ/Tutorial] CS Bomb Scripting
What defusing has to do with planting ? If the bomb is not planted how someone could be defusing it ? I mean, if the bomb is not yet planted m_bIsDefusing won't be always false ?
|
Re: [FAQ/Tutorial] CS Bomb Scripting
No need to think too much, It's kind of obvious I've misread.
But it's the same reasoning. You could probably just check m_bStartedArming which is set to false before BarTime is called. |
Re: [FAQ/Tutorial] CS Bomb Scripting
But m_bStatedArming doesn't make you sure that he started arming the bomb at some time. If the BarTime is called with correct filters you would know that at some point he started planting the bomb and then stopped. Holster() just "fix" BarTime problem with weapon switch when it's not updated correctly.
|
Re: [FAQ/Tutorial] CS Bomb Scripting
BarTime could be called anytime by any plugins and holster just detects one of possible reasons of stopping.
A more reliable way is to not rely on BarTime: Hooking WeaponIdle of weapon_c4 and checking m_bStartedArming. Code:
void CC4::WeaponIdle(void) |
Re: [FAQ/Tutorial] CS Bomb Scripting
Yes, this would do the trick. Also it's a good ideea to Enable the forward in Deploy() and to Disable it on Holster()
|
Re: [FAQ/Tutorial] CS Bomb Scripting
How can I avoid players getting points for defusing / planting the bomb?
Thanks. |
All times are GMT -4. The time now is 02:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.