AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Drop Weapon (https://forums.alliedmods.net/showthread.php?t=11107)

v3x 03-09-2005 19:48

Drop Weapon
 
Hey, I tried the simple code:
Code:
// ..     new clip, ammo     new weapon = get_user_weapon(id,clip,ammo)     if(weapon == CSW_SCOUT)     {         client_cmd(id,"drop")     }
But it makes em drop all weapons. How do I just make them drop that specific one?

KCE 03-09-2005 20:23

Re: Drop Weapon
 
http://forums.alliedmods.net/showthr...?t=8778+weapon

What about making the client call the drop impulse?

v3x 03-09-2005 20:55

Oh, so you have to put weapon_name behind it?

KCE 03-09-2005 21:20

Quote:

Originally Posted by v3x
Oh, so you have to put weapon_name behind it?

Quote:

Originally Posted by XxAvalanchexX
"drop weapon_scout" will work just as "drop". However, "drop" only works in dropping the scout if you have it selected; "drop weapon_scout" will drop the scout no matter what weapon you have out.

Quote:

Originally Posted by AMX Mod X Documentation
http://www.amxmodx.org/funcwiki.php?go=module&id=1#const_cswp
Code:

CS Weapon Constants:

CSW_P228                1
CSW_SCOUT                3
CSW_HEGRENADE                4
CSW_XM1014                5
CSW_C4                        6
CSW_MAC10                7
CSW_AUG                        8
CSW_SMOKEGRENADE        9
CSW_ELITE                10
CSW_FIVESEVEN                11
CSW_UMP45                12
CSW_SG550                13
CSW_GALI                14
CSW_GALIL                14
CSW_FAMAS                15
CSW_USP                        16
CSW_GLOCK18                17
CSW_AWP                        18
CSW_MP5NAVY                19
CSW_M249                20
CSW_M3                        21
CSW_M4A1                22
CSW_TMP                        23
CSW_G3SG1                24
CSW_FLASHBANG                25
CSW_DEAGLE                26
CSW_SG552                27
CSW_AK47                28
CSW_KNIFE                29
CSW_P90                        30



v3x 03-09-2005 21:34

Alright, I know what I'll do then.. Make them drop everything, give them a Glock/USP depending on their team..

And yes I know about the weapon names :P.

KCE 03-09-2005 21:39

Quote:

Originally Posted by v3x
Alright, I know what I'll do then.. Make them drop everything, give them a Glock/USP depending on their team..

And yes I know about the weapon names :P.

Here's some more code to help you if you need it:

Code:
new weapon_list[32] new weapon_num new i get_user_weapons(id, weapon_list,weapon_num) //SAVES ALL WEAPONS TO A LIST strip_user_weapons(id) //STRIPS ALL OF THE USER'S WEAPONS new weapon_name[33] for(i=0; i<32; i++){ //DO FOR EACH WEAPON IN LIST         get_weaponname(weapon_list[i], weapon_name,32)        //if(weapon_list[i] != weapon_pistol) //TO CHECK WHAT YOU ARE GIVING BACK }

v3x 03-09-2005 21:52

Ok, thanks.


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

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