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

Various weapon speeds


Post New Thread Reply   
 
Thread Tools Display Modes
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-18-2005 , 18:24  
Reply With Quote #11

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?
xeroblood is offline
Send a message via MSN to xeroblood
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-18-2005 , 19:40  
Reply With Quote #12

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).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 19:53  
Reply With Quote #13

Thanks Avalanche .
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-18-2005 , 20:00  
Reply With Quote #14

I'd recommend doing it this way:

Code:
#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...
Johnny got his gun is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 21:05  
Reply With Quote #15

Good idea!! Just like in PHP, hehe.. I like that way, switch statement. Also, can I add multiple functions in each case?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-18-2005 , 21:33  
Reply With Quote #16

Yes, but you have to use brackets.

Code:
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")))     } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 21:44  
Reply With Quote #17

Nice, thanks...I'll use this in my next plugin .
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-19-2005 , 07:31  
Reply With Quote #18

Well switch statements not only look good but apparantly they (should) run faster than doing endless lines of else ifs.
Johnny got his gun is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-19-2005 , 11:50  
Reply With Quote #19

Quote:
Originally Posted by Johnny got his gun
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 .
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
[415]StoNeD
Senior Member
Join Date: Mar 2004
Old 02-19-2005 , 21:11  
Reply With Quote #20

Why define this plug under "all"?
[415]StoNeD 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 21:19.


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