Raised This Month: $ Target: $400
 0% 

...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hectorz0r
Senior Member
Join Date: Oct 2008
Old 12-26-2009 , 00:03   ...
Reply With Quote #1

...

Last edited by hectorz0r; 04-07-2010 at 22:28.
hectorz0r is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-26-2009 , 00:47   Re: detect user weap
Reply With Quote #2

get_user_weapons(id, Weapons, numWeapons)

It works like get_players(); weapons must be [32] & numWeap an integrer.

Click on the link for more info
Mxnn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-26-2009 , 06:24   Re: detect user weap
Reply With Quote #3

You can use user_has_weapon() too.
__________________
Arkshine is offline
hectorz0r
Senior Member
Join Date: Oct 2008
Old 12-26-2009 , 13:08   Re: detect user weap
Reply With Quote #4

...

Last edited by hectorz0r; 04-07-2010 at 22:28.
hectorz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2009 , 13:16   Re: detect user weap
Reply With Quote #5

PHP Code:
new CSW_WHICHiWeaponEntityId
get_user_gun
(idslotCSW_WHICHiWeaponEntityId
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new const m_rgpPlayerItems[MAX_ITEM_TYPES] = {367,368,369,370,371,372}

get_user_gun(idslot, &iCswId, &iEntity)
{
    if( 
is_user_alive(id) )
    {
        if( (
iEntity get_pdata_cbase(idm_rgpPlayerItems[slot])) > )
        {
            
iCswId cs_get_weapon_id(iEntity)
        }
        else
        {
            
iCswId 0
            iEntity 
0
        
}
    }
    else
    {
        
iCswId 0
        iEntity 
0
    
}

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 12-26-2009 , 15:29   Re: detect user weap
Reply With Quote #6

Quote:
Originally Posted by hectorz0r View Post
Gimme an exemple of how to use user_has_weapon in this case.
PHP Code:
if ( user_has_weaponidCSW_* ) )
//stuff 
example
Code:
if ( user_has_weapon( id, CSW_KNIFE ) )
client_cmd( id, "exit" )
dFF is offline
hectorz0r
Senior Member
Join Date: Oct 2008
Old 12-26-2009 , 21:47   Re: detect user weap
Reply With Quote #7

...

Last edited by hectorz0r; 04-07-2010 at 22:28.
hectorz0r 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:04.


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