AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Weapon Speed (https://forums.alliedmods.net/showthread.php?t=275081)

Depresie 11-21-2015 14:22

[HELP] Weapon Speed
 
Can anyone explain to me how these works? how is that value measured in time?
Code:

set_pdata_float(iEnt, m_flNextSecondaryAttack, 0.0700, 4);

Bugsy 11-22-2015 11:30

Re: [HELP] Weapon Speed
 
It sets when the secondary attack can occur again for that weapon. The time is in seconds.

Depresie 11-22-2015 17:18

Re: [HELP] Weapon Speed
 
am i right if i say this is worse than callin prethink?

Bugsy 11-22-2015 17:36

Re: [HELP] Weapon Speed
 
No, far from it. What makes you think this is so bad? Not many things are worse than prethink.

Depresie 11-22-2015 18:08

Re: [HELP] Weapon Speed
 
called often

Bugsy 11-22-2015 18:43

Re: [HELP] Weapon Speed
 
Quote:

Originally Posted by Depresie (Post 2365565)
called often

Where are you calling this?

Depresie 11-23-2015 13:06

Re: [HELP] Weapon Speed
 
Sorry, forgot to mention, ham primary attack

Bugsy 11-23-2015 16:13

Re: [HELP] Weapon Speed
 
PrimaryAttack hook will keep firing if the attack1 button is pressed, even if the player is out of ammo.

Maybe try setting it with this instead? https://forums.alliedmods.net/showthread.php?t=54887

CrazY. 11-24-2015 09:10

Re: [HELP] Weapon Speed
 
I use this in my extra items:
Code:
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_name", "fw_PrimaryAttack_Post", 1);

Code:
public fw_PrimaryAttack_Post(weapon_entity) {     set_pdata_float(weapon_entity, 46, get_pcvar_float(your_cvar), 4); }

Bugsy 11-24-2015 11:25

Re: [HELP] Weapon Speed
 
CrazY, I never said it doesn't work, but if you put a client print in that callback you will see it spammed when you hold down primary attack button, even if no bullets are firing. It's my thought you would only want to set that when a bullet actually leaves the players gun.


All times are GMT -4. The time now is 18:14.

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