AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Checking secondary slot (https://forums.alliedmods.net/showthread.php?t=108644)

Doc-Holiday 11-07-2009 18:04

Checking secondary slot
 
I want to be able to check if player has a secondary weapon

i.e
PHP Code:

if(!Has_Secondary(id))
{
    
//Display Menu


Another question on that is there a way to close the menu automatically after a certain amount of time?

ConnorMcLeod 11-07-2009 19:12

Re: Checking secondary slot
 
PHP Code:

#define EXTRAOFFSET_PLAYER    5
#define m_rgpPlayerItems_Slot2    369

bool:Has_Secondary(id)
{
    new 
iWeapon get_pdata_cbase(idm_rgpPlayerItems_Slot2EXTRAOFFSET_PLAYER)
    return 
bool:(iWeapon 0)




All times are GMT -4. The time now is 17:47.

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