Raised This Month: $ Target: $400
 0% 

Checking weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-21-2011 , 07:13   Checking weapons
Reply With Quote #1

Is this correct way to check does user got FAMAS ?

PHP Code:
            new weapon get_user_weapon(id__);
            if(
weapon != CSW_FAMAS)
            {
                
dropPrimaryWeapons(id)
                
give_item(id"weapon_famas")
            }
            
cs_set_user_bpammo(idCSW_FAMAS90
If user got FAMAS, backpack ammo refills, if user does not have FAMAS, it drops current primary weapon and gives him FAMAS, and also refills ammo. Is it correct ?
reinert is offline
e12harry
Member
Join Date: Apr 2010
Old 09-21-2011 , 08:40   Re: Checking weapons
Reply With Quote #2

This only checks if player is holding FAMAS. If he is holding knife, but still has FAMAS he will drop it and than get another.

use
PHP Code:
get_user_weapons(index,weapons[32],&num
to get all weapons player has
e12harry is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-21-2011 , 08:42   Re: Checking weapons
Reply With Quote #3

Ok thanks.
reinert is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-21-2011 , 09:45   Re: Checking weapons
Reply With Quote #4

May be easier to do this so you won't need to loop through all carried weapons.
PHP Code:
if ( pevid pev_weapons ) & ( << CSW_FAMAS ) )
{
   
//player has famas

__________________
Bugsy is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-21-2011 , 10:48   Re: Checking weapons
Reply With Quote #5

user_has_weapon
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 19:34.


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