PDA

View Full Version : Various weapon speeds


v3x
02-18-2005, 16:41
Hi all! This is my first plugin, so please point out any errors if you find any!
/*
* Name: Various Weapon Speeds
* Version: 1.03
* Author: v3x (www.clanlock.com)
* Date: Feb. 18, 2004
*
* Description: Allows you to adjust the speed with these weapons/items: knife, c4, awp
*
* Cvars:
* knife_speed Default 410
* c4_speed Default 410
* awp_speed Default 320
* speed_glow Default 1
*
*
* Updates:
*
* V1.03
* - Added cvar: speed_glow <1:on|0:off>
* - Fixed a LOT of things
* - .0 is no longer needed in cvars
*
* V1.02
* - Added glow when knife is out (team color based)
* - Changed cvars
*
* V1.01
* - Updated with switch statements
*
*
*
* To do:
* - Fix freezetime bug
*
*/

#include <amxmodx>
#include <cstrike>
#include <fun>

Thanks to all that helped me :).

NOTE: You are better off with mp_freezetime set to 0 until I fix the bug.

genesis
02-18-2005, 16:58
this has to be quite possibly thee' worst plugin i have ever seen, well I suspect it has more to do with the amount of speed you set, on a different note, while trying to have a knife fight on your server your players gang bang others while knifing, they say use knife then its 3v1 and im the one???

v3x
02-18-2005, 17:04
I didn't ask for any negative comments..As I said in my post, this is my first plugin.

If you don't like the idea, then don't use it.

genesis
02-18-2005, 17:15
I'm trying to alert you that, changing the players maxspeed DRASTICALLY changes gameplay, so tweak it with care, I wouldn't recommend anything past 325, I mean while your at it can you make the awp more powerfull, or the m4 more precise, or the ump slower.

Negative comments are inheirent with any PUBLIC work.

NiGHTFiRE
02-18-2005, 17:21
I'm trying to alert you that, changing the players maxspeed DRASTICALLY changes gameplay, so tweak it with care, I wouldn't recommend anything past 325, I mean while your at it can you make the awp more powerfull, or the m4 more precise, or the ump slower.

Negative comments are inheirent with any PUBLIC work.
Just to alert you so is the DEFAULT speed 320 and 5 more isn't very much. You can change the speed yourself if you want then. It's not very nice to say that it's the worst plugin you have seen. Let's say you make your first plugin then just some person comes and says that this plugin sucks. I suggest that you say sorry for that. Like he said, this is his first plugin. Give him a brake.


@v3x This is a good job for your first plugin. I like it, but gensis has litttle right. I woudn't have it as 475, i would have it on 410 to start with.

v3x
02-18-2005, 17:23
Bro, I don't care about your personal opinion...my clan mate suggested it to me, so I made it.

When you switch back to the other weapons, it will change your speed back to default.

Enough said..

--

Thanks, NiGHTFiRE... I'll do that.

NiGHTFiRE
02-18-2005, 17:27
No problem, like i said before, GJ. This is your first plugin and it's nice done by some one that just started.
What I like about this plugin is basically that I don't think anyone won't be fine with increased speeds. More speed = Intenser Rounds, More Killz, Tougher Knife Fights and Faster Movements.

genesis
02-18-2005, 17:30
nightfire maybe if you were in his server and saw the complete pandamonium[sic], you'de understand but actually on my server knife does have a speed of 325 and its perfect. 5 is a lot in cs motion terms. I will reterm it though anything under 350 should be fine.

v3x I know you don't care about others' opinions, and thats ok, be servers are basically a popularity contest, so I hope you go far you ruthless dictator.

NiGHTFiRE
02-18-2005, 17:33
What I like about this plugin is basically that I don't think anyone won't be fine with increased speeds. More speed = Intenser Rounds, More Killz, Tougher Knife Fights and Faster Movements.
That's the fun about it! Every thing goes so fast so no one can camp! userstand now?

v3x
02-18-2005, 17:38
Also, if you are running with a knife or C4, you are a lot more vulnerable than if you were holding an M4 (so to say). If you don't like one of the speeds, just set it to default. You can bitch/spam all you want, it doesn't affect me one bit :).

xeroblood
02-18-2005, 18:24
Good Job on the plugin v3x!

@genesis:
Why not just adjust the cvar 'sv_knifespeed' to your own liking??
And what is wrong with people sharing to the public? He could've just kept it to himself, but he chose to share it, for others who may find it useful!!
Critisism is cool and all, but what's wrong with being polite about it?

XxAvalanchexX
02-18-2005, 19:40
Nice job on the plugin. And a note to everyone that uses this, you can set the maxspeed lower than the usual if you want AWPs to be immobile or the C4 to be heavy, it doesn't have to be used to make people run faster.

I voted 4, but it seems that someone else gave it a 1 (4 + 1 over 2 = 2.50, there current score).

v3x
02-18-2005, 19:53
Thanks Avalanche :).

Johnny got his gun
02-18-2005, 20:00
I'd recommend doing it this way:

#define PLUGIN "Various Weapon Speeds"
#define AUTHOR "v3x"
#define VERSION "1.00"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "check_speed", "be")
register_cvar("sv_knifespeed", "410.0")
register_cvar("sv_c4speed", "410.0")
register_cvar("sv_awpspeed", "320.0")
}

public check_speed(id) {
new clip, ammo
new weapon = get_user_weapon(id, clip, ammo)

switch (weapon) {
case CSW_KNIFE: set_user_maxspeed(id,(get_cvar_float("sv_knifespeed")))
case CSW_C4: set_user_maxspeed(id,(get_cvar_float("sv_c4speed")))
case CSW_AWP: set_user_maxspeed(id,(get_cvar_float("sv_awpspeed")))
}

return PLUGIN_CONTINUE
}


You probably want to return PLUGIN_CONTINUE or other plugins won't catch this event if they are below this plugin in plugins.ini...

v3x
02-18-2005, 21:05
Good idea!! Just like in PHP, hehe.. I like that way, switch statement. Also, can I add multiple functions in each case?

XxAvalanchexX
02-18-2005, 21:33
Yes, but you have to use brackets.

switch (weapon) {
case CSW_KNIFE: {
set_user_maxspeed(id,(get_cvar_float("sv_knifespeed")))
}
case CSW_C4: {
set_user_maxspeed(id,(get_cvar_float("sv_c4speed")))
}
case CSW_AWP: {
set_user_maxspeed(id,(get_cvar_float("sv_awpspeed")))
}
}

v3x
02-18-2005, 21:44
Nice, thanks...I'll use this in my next plugin :).

Johnny got his gun
02-19-2005, 07:31
Well switch statements not only look good but apparantly they (should) run faster than doing endless lines of else ifs.

v3x
02-19-2005, 11:50
Well switch statements not only look good but apparantly they (should) run faster than doing endless lines of else ifs.
Yea, I notice that they do clean up the code pretty good :).

[415]StoNeD
02-19-2005, 21:11
Why define this plug under "all"?

v3x
02-19-2005, 22:39
StoNeD]Why define this plug under "all"?
Hehe, sorry...I must have overlooked it when I edited it :shock:.

[415]StoNeD
02-20-2005, 01:03
Np.. I was hoping there'd be something for the velocity of a grenade throw.. that be the shit. :D

v3x
02-21-2005, 20:31
- Updated: V1.02 -

itchycooter
03-17-2005, 05:05
What I like about this plugin is basically that I don't think anyone won't be fine with increased speeds. More speed = Intenser Rounds, More Killz, Tougher Knife Fights and Faster Movements.
That's the fun about it! Every thing goes so fast so no one can camp! userstand now?

"weaponarena random; rcon mp_roundtime 1" :P

Great idea for a plugin!!
I havent tested this yet but will soon enough.
Keep em comin :D

v3x
06-12-2005, 04:35
Hmm.. I just looked at the code and decided to update it.

v1.03:
- Added cvar: speed_glow <1:on|0:off>
- Fixed a LOT of things (some things were missing)
- .0 is no longer needed in cvars

I can't believe I'm still updating this.. :p

spunko
11-21-2005, 17:41
ummm.. one link is broken.. i just downloaded .sma, but the pluginin link is broken.. can someone fix it??

v3x
11-21-2005, 17:52
Manually compile it.

Marz
11-21-2005, 18:54
How would you manually compile something?

v3x
11-21-2005, 21:39
http://www.amxmodx.org/doc/source/plugins/plugins.htm#compile

The_One
01-25-2006, 10:42
this doesnt make my knife any faster? is this supposed increase the speed of your knife like a hack? or does it increase you overall speed when holding it?

SweatyBanana
01-25-2006, 15:07
this doesnt make my knife any faster? is this supposed increase the speed of your knife like a hack? or does it increase you overall speed when holding it?

Speed of the weapon..like you could make an m4 fire 10x faster.

v3x
01-25-2006, 17:33
this doesnt make my knife any faster? is this supposed increase the speed of your knife like a hack? or does it increase you overall speed when holding it?

beezkneez2006
03-26-2006, 10:30
Im having an issue, i have awp speed set to normal and my knife speed incresead, but you run just as fast with your awp as your knife, and its fast lol.. not good ^_^

beezkneez2006
03-28-2006, 12:17
bump?

v3x
03-28-2006, 14:35
Change line 54 to this:
register_event("CurWeapon","check_speed","be","1=1")

XNaRu7oX
03-22-2007, 18:42
how come on my knife only + auto respawn server, when people respawn they don't get the speed.

is there any way to fix this w/o removing the auto respawn?

~HonDo~
09-26-2007, 15:11
hey V3x , HonDo here and i was woundering if there is a whay to get this plugin do wal silent??? plugin is awsome , but, but, but , when i run with knife on its all good, but when i walk with knife on it still makes the runnung sound. is there a what to get the walk key to automaticly go back to reg walk with knife??? thx


:up:-= RooKiE BiaTcH =- ~Hondo~ 63.208.142.45:27015 :up:

teknoboy174
03-03-2008, 13:07
great plugin thank a million fer posting it to the world

teknoboy174
03-03-2008, 14:10
how do you make it stop glowing? i'm getting numerious complaints about the glow is their anyway to shut it off?

hoboman
04-13-2008, 14:35
you should make this so when a player is walking with a weapon that has a speed bonus, he wouldn't emit the footsteps sound

dissonantallure
04-24-2008, 20:38
Hello I love this plugin :up: . One small bug i noticed is after you knife kill someone your knife speed is lost. You can fix this by quickly changing your weapon with Q but i noticed this bug in other knife plugins as well http://forums.alliedmods.net/showthread.php?p=378952 & http://forums.alliedmods.net/showthread.php?t=9272 . Is there a fix for this very small bug? Thanks alot!

v3x
04-24-2008, 21:19
Hello I love this plugin :up: . One small bug i noticed is after you knife kill someone your knife speed is lost. You can fix this by quickly changing your weapon with Q but i noticed this bug in other knife plugins as well http://forums.alliedmods.net/showthread.php?p=378952 & http://forums.alliedmods.net/showthread.php?t=9272 . Is there a fix for this very small bug? Thanks alot!
Change line 54 to this:
Code:
register_event("CurWeapon","check_speed","be","1=1")


That should fix it.

dissonantallure
04-24-2008, 22:13
I changed line 54 and compiled but still same bug. Thanx alot for replying though!!! :) Ill try any other suggestions you have.

v3x
04-24-2008, 22:50
Try this one. It should fix that bug plus the freezetime bug. Test that for me as well if ya can.

Thanks.

dissonantallure
04-24-2008, 23:17
Tried the plugin and the source neither worked. The bug for the freeze time is also still there you can switch to your knife and run freely during freezetime but as soon as the game timer starts your knife speed is normal. Switching weapons with q always fixes it though. How strange... Im glad to test any updates ill run them on a stock amxx server with no other plugins interfering.

v3x
04-25-2008, 00:03
That's odd. I can't think of anything else that would fix it. I don't really manage this plugin anymore as it was my first from a long time ago.

dissonantallure
04-25-2008, 00:44
Haha yea i am learning about all these plugins and scripting its hard. The plugin works great as is pressing q is no problem for me lol. I like this plugin better than others because its simple no models or anything just nice simple speed adjuster makes gungame 10X more fun! Gj & thanx for responding! :up:

hoboman
04-25-2008, 16:41
here is a much more optimized version that uses pcvars among other things...

dissonantallure
04-25-2008, 19:47
Im trying now thanks!!

dissonantallure
04-30-2008, 06:29
Update: I made my own version using your code as a base. Check it out here http://forums.alliedmods.net/showthread.php?t=70958

midnite8
10-20-2008, 00:12
I just want to use the knife speed boost and not anything else.

I set the knife_speed variable to 310 in my server.cfg and everything else to 0 since my server is a 24/7 assault server i do not require anything else but the knife speed boost.

The problem is that every time map restarts or server restarts every setting goes back to default. I save my server.cfg files...

What causes this problem?

noobkake
11-02-2008, 08:53
Well Done!
Good Plugins!

ConnorMcLeod
03-31-2009, 16:18
NOTE: You are better off with mp_freezetime set to 0 until I fix the bug.

Fixed (was already with this horrible task ?), plugin updated with better code, new speed_glow cvar setting (2=random color)

Arkshine
11-01-2010, 06:09
This plugin, Weapon MaxSpeed (http://forums.alliedmods.net/showthread.php?t=139521), is better coded, more complete and bug-free.

Unapproved.

Momento
06-06-2011, 13:24
Hi everyone i have a problem with max knife speed it doesn't incress more then 410 i try to change sv_maxspeed knife_speed doesn't work also i try with amx cmd nolucky i runing a bit faster then default but as i said 410 thats what i can get but padbots a runing more faster if i change more then 410 but not me dunno why i found a server who has max speed with knife after i connect to that server and back to main speed starts working i can get more then 410 i have no idea whats wrong so i have to log to that server to get max speed in my server. Is there anyone can help me this?

Arkshine
06-06-2011, 14:01
Use the plugin in the previous post.

Momento
06-06-2011, 14:10
I tryed that one it same :/

Madster94
12-30-2016, 10:16
Thanks buddy
Nice work
CAN i Increase speed a bit more ?