This site is a testing version, but all data is shared with the live forum.


Raised This Month: $12 Target: $400
 3% 

Varied Weapon Speeds


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Half-Life        Category:   Gameplay       
TaRgEt*TuRkEy
Member
Join Date: Oct 2004
Old 10-07-2007 , 22:41   Varied Weapon Speeds
Reply With Quote #1

This is my third plugin after a long hiatus. This one is for Half-Life and set for creating a more dynamic playing style. In a sense, this adds counter-strike like gameplay to Half-Life DM by changing the running speeds based on which weapon you are carrying.

CVARS:
amx_crowbar_speed
amx_9mmhandgun_speed
amx_357_speed
amx_9mmAR_speed
amx_shotgun_speed
amx_crossbow_speed
amx_rpg_speed
amx_gauss_speed
amx_egon_speed
amx_hornetgun_speed
amx_handgrenade_speed
amx_tripmine_speed
amx_satchel_speed
amx_snark_speed

NOTE: YOU MUST SET YOUR SERVER "sv_maxspeed" TO A HIGHER VALUE TO USE VALUES IN THIS PLUGIN THAT ARE OVER THE STANDARD "270". To be safe put the following line in server.cfg or listenserver.cfg:

sv_maxspeed 400


Code:
/***************************************************************
	Varied Weapon Speeds
	Author: TaRgEt*TuRkEy (Code From Rabid Baboon & MMX)
	Version: 1.1
	Mod: Half-Life Deathmatch (Valve)
	Requires: AMX Mod X v1.0 
	Description:
		This plugin creates a more dynamic feel to 
		weapons in Half-Life by varying the maxspeed
		based on which weapon you are holding. For
		example, you can run faster with a crowbar
		than you can with a rocket launcher. You can
		control maxspeeds using the cvars on the fly
		or in server.cfg/listenserver.cfg. I used
		entity names for the cvars instead of official
		weapon names (ex: tau cannon = guass).

	NOTE:	YOU MUST SET YOUR SERVER "sv_maxspeed" TO A
		HIGHER VALUE TO USE VALUES IN THIS PLUGIN THAT
		ARE OVER THE STANDARD "270". 

		To be safe put the following line in server.cfg
		or listenserver.cfg:

		sv_maxspeed 400

	Cvars:	amx_crowbar_speed 	<number>
		amx_9mmhandgun_speed 	<number>
		amx_357_speed 		<number>
		amx_9mmAR_speed 	<number>
		amx_shotgun_speed	<number>
		amx_crossbow_speed	<number>
		amx_rpg_speed		<number>
		amx_gauss_speed		<number>
		amx_egon_speed		<number>
		amx_hornetgun_speed	<number>
		amx_handgrenade_speed	<number>
		amx_tripmine_speed	<number>
		amx_satchel_speed	<number>
		amx_snark_speed		<number>

***************************************************************/

#include <amxmodx> 
#include <fun>

new Title[32] = "Varied Weapon Speeds"
new Version[32] = "1.1"
new Author[16] = "TaRgEt*TuRkEy"

new Float:maxSpeed

public WeaponSwitch(id)
{ 	
	new wepi = read_data(2)

	switch (wepi)
	{
		case 1:
			maxSpeed = get_cvar_float("amx_crowbar_speed")
		case 2:
			maxSpeed = get_cvar_float("amx_9mmhandgun_speed")
		case 3:
			maxSpeed = get_cvar_float("amx_357_speed")
		case 4:
			maxSpeed = get_cvar_float("amx_9mmAR_speed")
		case 6:
			maxSpeed = get_cvar_float("amx_crossbow_speed")
		case 7:
			maxSpeed = get_cvar_float("amx_shotgun_speed")
		case 8:
			maxSpeed = get_cvar_float("amx_rpg_speed")
		case 9:
			maxSpeed = get_cvar_float("amx_gauss_speed")
		case 10:
			maxSpeed = get_cvar_float("amx_egon_speed")
		case 11:
			maxSpeed = get_cvar_float("amx_hornetgun_speed")
		case 12:
			maxSpeed = get_cvar_float("amx_handgrenade_speed")
		case 13:
			maxSpeed = get_cvar_float("amx_tripmine_speed")
		case 14:
			maxSpeed = get_cvar_float("amx_satchel_speed")
		case 15:
			maxSpeed = get_cvar_float("amx_snark_speed")
	}
	
	set_user_maxspeed(id,maxSpeed)

	return PLUGIN_HANDLED
}


public plugin_init() 
{ 
	register_plugin(Title,Version,Author)
	register_event("CurWeapon","WeaponSwitch","b","1=1")
	register_cvar("amx_crowbar_speed","350")
	register_cvar("amx_9mmhandgun_speed","320")
	register_cvar("amx_357_speed","300")
	register_cvar("amx_9mmAR_speed","260")
	register_cvar("amx_shotgun_speed","250")
	register_cvar("amx_crossbow_speed","270")
	register_cvar("amx_rpg_speed","200")
	register_cvar("amx_gauss_speed","220")
	register_cvar("amx_egon_speed","100")
	register_cvar("amx_hornetgun_speed","220")
	register_cvar("amx_handgrenade_speed","380")
	register_cvar("amx_tripmine_speed","370")
	register_cvar("amx_satchel_speed","340")
	register_cvar("amx_snark_speed","390")
	return PLUGIN_HANDLED 
}
Attached Files
File Type: sma Get Plugin or Get Source (variedweaponspeeds.sma - 938 views - 3.2 KB)
__________________

Last edited by TaRgEt*TuRkEy; 10-09-2007 at 17:31.
TaRgEt*TuRkEy is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-07-2007 , 22:44   Re: Varied Weapon Speeds
Reply With Quote #2

Just a suggestion, make it read from a file. Right now this plugin lacks functionality. Reading from a file is easier than having as many cvars as there are weapons, and with that you could make it for multiple-mods. Not too many people play half-life anymore. At least not with TF2 and stuff out

Hmmm sounds a lot like what Zenith said
__________________

Last edited by M249-M4A1; 10-07-2007 at 22:49.
M249-M4A1 is offline
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 10-08-2007 , 02:28   Re: Varied Weapon Speeds
Reply With Quote #3

No need for engine to be included.

Why should sv_maxspeed be 1000 ? Atleast in CS it stops working after 400, and then you'd have to start editing cvars like cl_forwardspeed, etc. (Look who's talking ) Besides, you're not setting speeds that high by default anyway.

Anyways, good to see plugins for HL!
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-09-2007 , 16:27   Re: Varied Weapon Speeds
Reply With Quote #4

Look at TFC Weapon Gravity plugin to see how this can be done more efficiently.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
TaRgEt*TuRkEy
Member
Join Date: Oct 2004
Old 10-09-2007 , 17:24   Re: Varied Weapon Speeds
Reply With Quote #5

Quote:
Originally Posted by Zenith77 View Post
Look at TFC Weapon Gravity plugin to see how this can be done more efficiently.
Hmmm that script seems to use percentiles instead of value based numerals that any HL server admin would know about when they set their sv_maxspeed. Unless you mean that it uses string based functions ("TFC_WPN_AC") rather than numerical ones like mine.

Well anyways, I removed some redundancy in my coding, and cleaned some things up as per Pro Patria Finland suggestions.
__________________

Last edited by TaRgEt*TuRkEy; 10-09-2007 at 17:30.
TaRgEt*TuRkEy is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-09-2007 , 18:24   Re: Varied Weapon Speeds
Reply With Quote #6

Here's a more efficient method, as it:

1) Reads from a file
2) No need to register as many cvars as there are weapons
3) Code is 1/3 the size
Attached Files
File Type: cfg speedconfig.cfg (68 Bytes, 130 views)
File Type: sma Get Plugin or Get Source (variedweaponspeeds.sma - 828 views - 2.3 KB)
__________________

Last edited by M249-M4A1; 10-10-2007 at 19:56.
M249-M4A1 is offline
_Tool_
Junior Member
Join Date: Sep 2007
Old 10-11-2007 , 11:09   Re: Varied Weapon Speeds
Reply With Quote #7

Another worthless one. When are people going to make original and good plugins instead of stupid maxspeed/gravity plugins about a "super duper assasinator" or predator etc. Quality over quantity.
_Tool_ is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-12-2007 , 16:04   Re: Varied Weapon Speeds
Reply With Quote #8

Quote:
Originally Posted by _Tool_ View Post
Another worthless one. When are people going to make original and good plugins instead of stupid maxspeed/gravity plugins about a "super duper assasinator" or predator etc. Quality over quantity.
^
|

Unapproved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TaRgEt*TuRkEy
Member
Join Date: Oct 2004
Old 10-13-2007 , 11:16   Re: Varied Weapon Speeds
Reply With Quote #9

Quote:
Originally Posted by _Tool_ View Post
Another worthless one. When are people going to make original and good plugins instead of stupid maxspeed/gravity plugins about a "super duper assasinator" or predator etc. Quality over quantity.
This is something I use on my own server. I figured I would share it because this has been something a lot of server admins have wanted for Half-Life DM. You obviously don't play HLDM, therefore, have no idea of worth, and considering this doesn't exist on these forums, it's quite "original".

It's also funny to mention that plugin submission is getting more and more picked over as submissions keep decreasing. You would think that the forum members/admins would want to try to preserve a good constant rate of plugin submissions instead of critisizing people enough that they want to leave the forums and never submit again. I thought this was AlliedModders, not ElitistModders.
__________________

Last edited by TaRgEt*TuRkEy; 10-13-2007 at 12:16.
TaRgEt*TuRkEy is offline
Jheshka
Senior Member
Join Date: Dec 2005
Old 10-13-2007 , 11:58   Re: Varied Weapon Speeds
Reply With Quote #10

Quote:
Originally Posted by TaRgEt*TuRkEy View Post
This is something I use on my own server. I figured I would share it because this has been something a lot of server admins have wanted for Half-Life DM. You obviously don't play HLDM, therefore, have no idea of worth, and considering this doesn't exist on these forums, it's quite "original".

It's also funny to mention that plugin submission is getting more and more picked over as submissions keep decreasing. You would think that the forum members/admins would want to try to preserve a good constant rate of plugin submissions instead of critisizing people enough that they want to leave the forums and never submit again.
Not really... If it's a bad plugin, poorly coded... I don't see why anyone would need this.
__________________
James
Jheshka is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:05.


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