Raised This Month: $ Target: $400
 0% 

User weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 01:05   User weapon
Reply With Quote #1

Hey, I know how in PHP you do an IF statement like if($weapon == "1") { // do something }. Well, I need to know how to do this in AMXX lol..So if anybody could help me, I'd appreciate it. Thanks.
__________________
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
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-18-2005 , 01:12   easy
Reply With Quote #2

Code:
new clip, ammo new arsenal = get_user_weapon(id, clip, ammo) if(arsenal == CSW_C4) {     blah blah }
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 01:15  
Reply With Quote #3

Oh, I was going to do it a different way. I was going to use cs_get_weapon_id.

So would these be correct?
CSW_KNIFE
CSW_AWP
__________________
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
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-18-2005 , 01:24   yep
Reply With Quote #4

Code:
/* Id of weapons in CS */
#define CSW_P228		1
#define CSW_SCOUT		3
#define CSW_HEGRENADE		4
#define CSW_XM1014		5
#define CSW_C4			6
#define CSW_MAC10		7
#define CSW_AUG			8
#define CSW_SMOKEGRENADE	9
#define CSW_ELITE		10
#define CSW_FIVESEVEN		11
#define CSW_UMP45		12
#define CSW_SG550		13
#define CSW_GALI		14
#define CSW_GALIL		14
#define CSW_FAMAS		15
#define CSW_USP			16
#define CSW_GLOCK18		17
#define CSW_AWP			18
#define CSW_MP5NAVY		19
#define CSW_M249		20
#define CSW_M3			21
#define CSW_M4A1		22
#define CSW_TMP			23
#define CSW_G3SG1		24
#define CSW_FLASHBANG		25
#define CSW_DEAGLE		26
#define CSW_SG552		27
#define CSW_AK47		28
#define CSW_KNIFE		29
#define CSW_P90			30
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 01:26  
Reply With Quote #5

Oh, k..thanks for the list!

Also, one more quick question...If I were to use set_user_maxspeed, what is the default speed of players in CS?
__________________
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
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-18-2005 , 01:30   kk
Reply With Quote #6

320 is defualt, when you use set_user_maxspeed, remember the speed is a float value, example:

Code:
new Float:normal = 320.0 set_user_maxspeed(id, normal)
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 02:09  
Reply With Quote #7

Alright, I'm having a bit of trouble now..here's my code:
Code:
#include <amxmodx> #include <cstrike> #include <fun> new PLUGIN[]="AWP/C4/Knife speeds" new AUTHOR[]="v3x" new VERSION[]="1.00" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } #define C4SPEED 375.0 #define KNIFESPEED 375.0 #define AWPSPEED 320.0 new clip, ammo new weapon = get_user_weapon(id, clip, ammo) if(weapon == CSW_KNIFE) {     new Float:kspd = KNIFESPEED     set_user_maxspeed(id, kspd)     return PLUGIN_HANDLED } if(weapon == CSW_C4) {     new Float:c4spd = C4SPEED     set_user_maxspeed(id, c4spd)     return PLUGIN_HANDLED } if(weapon == CSW_AWP) {     new Float:awpspd = AWPSPEED     set_user_maxspeed(id, awpspd)     return PLUGIN_HANDLED }
Keep in mind that this is my first attempt at making a plugin, lol.
__________________
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
philman213
Member
Join Date: Feb 2005
Location: WA
Old 02-18-2005 , 02:14  
Reply With Quote #8

What errors are you getting?
philman213 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2005 , 02:15  
Reply With Quote #9

No errors at all when I compile. It's just when I'm in the game it doesn't seem to set the speed higher. Maybe I just have the speeds wrong?
__________________
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
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-18-2005 , 10:31   hmmm
Reply With Quote #10

lol 375 isn't high at all.... you wouldn't even notice a diff. Try 450-500 and also I would add this:

Code:
register_event("CurWeapon", "check_speed", "be") public check_speed(id) {     new clip, ammo     new weapon = get_user_weapon(id, clip, ammo)     if(weapon == CSW_KNIFE) {         new Float:kspd = KNIFESPEED         set_user_maxspeed(id, kspd)         return PLUGIN_HANDLED     }     if(weapon == CSW_C4) {         new Float:c4spd = C4SPEED         set_user_maxspeed(id, c4spd)         return PLUGIN_HANDLED     }     if(weapon == CSW_AWP) {         new Float:awpspd = AWPSPEED         set_user_maxspeed(id, awpspd)         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }

now if they change their weapon their speed will not stop.
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
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 13:59.


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