Raised This Month: $ Target: $400
 0% 

[SOLVED] Has medkit or defibrillator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cigs
Senior Member
Join Date: Jul 2006
Old 03-24-2010 , 15:19   [SOLVED] Has medkit or defibrillator
Reply With Quote #1

I'm trying to check if a player has a medkit or defibrillator in slot4 with GetPlayerWeaponSlot(client, 3)
But for some reason that doesn't work.

PHP Code:
    for (new client 1client <= MaxClientsclient++)
    {
        if (
IsClientConnected(client))
        {
            if (
IsClientInGame(client))
            {    
                if (!
IsFakeClient(client) && GetClientTeam(client) == && IsPlayerAlive(client))
                {
                    new 
ent GetPlayerWeaponSlot(client3)
                    if (
ent != -1)
                        continue
                    
                    
// client has neither, do this...
                
}
            }    
        }            
    } 
__________________

Last edited by cigs; 03-25-2010 at 13:25.
cigs is offline
cigs
Senior Member
Join Date: Jul 2006
Old 03-25-2010 , 06:29   Re: Has medkit or defibrillator
Reply With Quote #2

Can anyone explain how I can use the network property m_hMyWeapons to find out if a survivor is carrying a medkit or defib? http://wiki.alliedmods.net/Left_4_De...s#CBasePlayer:
__________________
cigs is offline
cigs
Senior Member
Join Date: Jul 2006
Old 03-25-2010 , 13:25   Re: Has medkit or defibrillator
Reply With Quote #3

Thx, psychonic!

PHP Code:
for (new client 1client <= MaxClientsclient++)
    {
        if (
IsClientConnected(client))
        {
            if (
IsClientInGame(client))
            {    
                if (!
IsFakeClient(client) && GetClientTeam(client) == && IsPlayerAlive(client))
                {
                    if (!
IsValidEdict(GetPlayerWeaponSlot(client3)))
                         
// client has neither, do this...
                
}
            }    
        }            
    } 
__________________
cigs 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 20:43.


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