CurWeapon Event
Hello, I'm trying to make some actions when a client changes his weapon, but nothing seems to work here :
#include <amxmodx> public plugin_init(){ register_plugin("knife Buffs" , AMXX_VERSION_STR , "LeOpArD") register_event("CurWeapon" , "knifeBuff", "a") } public knifeBuff(id) { client_print(0, print_chat, "CurWeapon event triggered for client %d!", id); return PLUGIN_HANDLED; } |
Re: CurWeapon Event
Try
register_event("CurWeapon" , "knifeBuff" , "be" , "1=1" ); |
Re: CurWeapon Event
Quote:
so 'b' means it will be sent to a single client, and 'e' if hes alive ! IT worked perfectly, but i couldn't understand the condition part |
Re: CurWeapon Event
Quote:
https://www.amxmodx.org/api/amxmodx/register_event |
Re: CurWeapon Event
These are what you have to work with from a conditions perspective in the CurWeapon event.
https://wiki.alliedmods.net/Half-life_1_game_events Code:
Name: CurWeapon 1=IsActive 2=WeaponID 3=ClipAmmo So the "1=1" you see above means IsActive must be 1 for the event to trigger in your plugin. Another example using the 2nd argument of WeaponID. With CSW_AK47=28, you could add a condition to make it only fire on the AK47 by adding: "2=28" register_event("CurWeapon" , "AK47Only" , "be" , "1=1" , "2=28" ); Or everything except AK47 register_event("CurWeapon" , "AK47Only" , "be" , "1=1" , "2!28" ); |
Re: CurWeapon Event
sorry to interrupt, I leave this method and withdraw slowly...
PHP Code:
|
Re: CurWeapon Event
“and withdraw slowly”? What does that mean?
|
Re: CurWeapon Event
it's a...
meme
|
Re: CurWeapon Event
@LeOp4rD, register_event_ex is easier to read. Flags are in English instead of letters.
Code:
Spoiler
|
Re: CurWeapon Event
Or just use register_event()…
|
All times are GMT -4. The time now is 17:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.