Client throws a grenade > call function
Read the title!
I'm scripting for a Half-Life (1) mod youv'e never heard of (Half-Life 2: Jakin' Bacon Source). In that mod you can use normal Half-Life grenades. I want to play a sound everytime a player throws a grenade (by executing the "spk" command in that players console). So I want to call a function when a player releases a grenade. Is there a way to do this? Please help me. |
Re: Client throws a grenade > call function
Use a current weapon event like this
Code:
It says that the weapon has to be a he grenade(4). :wink: The first paramter is the event , the 2nd is the funtion that your hooking to, whatever fucntion youll be calling your code in , then the 3rd paramter is the weapon is active , then the conditions |
Re: Client throws a grenade > call function
|
Re: Client throws a grenade > call function
Yes If you wanna use CSX you can use that .
|
Re: Client throws a grenade > call function
Quote:
|
Re: Client throws a grenade > call function
The grenade_throw forwards are only for Counter-Strike and Day of Defeat.
I'd hook FM_SetModel, look for the world grenade model, and then check its owner (make sure it even has one, if not it must not be a thrown grenade). |
Re: Client throws a grenade > call function
Quote:
|
Re: Client throws a grenade > call function
Simply instruct the server operators to place this plugin higher on the list than model changing plugins. Since almost every single model changing plugin changes world models with a FM_SetModel hook, this one will be called first.
If you don't want to do it by model, still hook FM_SetModel, but check classname. |
Re: Client throws a grenade > call function
Quote:
|
Re: Client throws a grenade > call function
Why don't you know what the model will be?
|
| All times are GMT -4. The time now is 22:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.