Raised This Month: $ Target: $400
 0% 

Get user weapons on death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-29-2014 , 00:00   Re: Get user weapons on death
Reply With Quote #1

You'd do something like:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

new iWeapons[33][32]

public 
plugin_init() 
{
    
RegisterHam(Ham_Killed"player""eventPlayerKilled"false)
    
RegisterHam(Ham_Spawn"player""eventPlayerSpawned"true)
}

public 
eventPlayerKilled(id)
{
    new 
iNum
    get_user_weapons
(idiWeapons[id], iNum)
}

public 
eventPlayerSpawned(id)
{
    if(!
is_user_alive(id))
    {
        return 
HAM_IGNORED
    
}
    
    new 
szWeaponName[45]
    
    for(new 
032i++)
    {
        if(
iWeapons[id][i])
        {
            
get_weaponname(iWeapons[id][i], szWeaponNamecharsmax(szWeaponName))
            
            
give_item(idszWeaponName)
        }
    }
    
    
arrayset(iWeapons[id], 032)
    
    return 
HAM_IGNORED

mottzi is offline
Send a message via MSN to mottzi
Old 07-29-2014, 05:05
Flick3rR
This message has been deleted by Flick3rR.
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 13:02.


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