Raised This Month: $ Target: $400
 0% 

Detect Drop primary weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-23-2009 , 14:09   Detect Drop primary weapon?
Reply With Quote #1

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.
laziboi72 is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 12-23-2009 , 14:55   Re: Detect Drop primary weapon?
Reply With Quote #2

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

__________________
minimiller is offline
Send a message via MSN to minimiller
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-23-2009 , 14:57   Re: Detect Drop primary weapon?
Reply With Quote #3

thanks bro
i will do my thang now lol
+k as soon as i am able to agaiin =)))
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE
laziboi72 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 04:05.


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