AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Chargeable Fire (https://forums.alliedmods.net/showthread.php?t=195688)

SpeeDeeR 09-10-2012 10:59

Chargeable Fire
 
I am making a weapon which can fire nades.
I want to make it while holding the primary attack button, the weapon charges in order for the nade to gain more velocity, like the sticky gun in TF2.

matsi 09-10-2012 11:23

Re: Chargeable Fire
 
And what is your question?

SpeeDeeR 09-10-2012 18:53

Re: Chargeable Fire
 
How can I make that chargeable fire.

jimaway 09-10-2012 19:08

Re: Chargeable Fire
 
hook FM_cmdstart and FM_cmdend, check if primary attack command is started and create task to increace a global variable until the FM_cmdend is triggered, create the nade in FM_cmdend forward and calculate its velocity some way using the global variable you increaced with task

SpeeDeeR 09-11-2012 07:40

Re: Chargeable Fire
 
Quote:

Originally Posted by jimaway (Post 1796275)
hook FM_cmdstart and FM_cmdend, check if primary attack command is started and create task to increace a global variable until the FM_cmdend is triggered, create the nade in FM_cmdend forward and calculate its velocity some way using the global variable you increaced with task

How can I get the entity index of the weapon the player is holding while pressing the fire in order to block its action.

jimaway 09-11-2012 07:51

Re: Chargeable Fire
 
Code:
if (get_user_weapon(id) == CSW_THATWEAPON)     new wid = find_ent_by_owner(-1, "weapon_thatweapon", id)


All times are GMT -4. The time now is 08:17.

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