AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect Drop primary weapon? (https://forums.alliedmods.net/showthread.php?t=113111)

laziboi72 12-23-2009 14:09

Detect Drop primary weapon?
 
How do i detect when a user drops their primary weapon?
like i know there is this
PHP Code:

register_clcmd"drop""removeweapon" ); 

but that registers when the player drops any weapon... i want to detect only why they drop their primary weapon. :)

minimiller 12-23-2009 14:55

Re: Detect Drop primary weapon?
 
PHP Code:

#define PRIMARY_WEAPONS_BITSUM    ((1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90))
#define is_primary_weapon(%1)        (PRIMARY_WEAPONS_BITSUM & (1<<%1)) 

public removeweapon(id)
{
    new 
iWeapon get_user_weapon(id);
    
    if(
is_primary_weapon(iWeapon))
        
//Do your thang



laziboi72 12-23-2009 14:57

Re: Detect Drop primary weapon?
 
thanks bro
i will do my thang now lol
+k as soon as i am able to agaiin =)))


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

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