AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Best way to log buy (https://forums.alliedmods.net/showthread.php?t=143651)

Javivi 11-22-2010 12:56

Best way to log buy
 
What's the best way to log what someone buy ? ( including bullets and grenades )

bibu 11-22-2010 14:57

Re: Best way to log buy
 
Maybe this can help you.

PHP Code:

/* http://forums.alliedmods.net/showthread.php?t=59057&highlight=weapon+buy */

#include <amxmodx>

#define MAX_CLIENTS 32
new g_weapons[MAX_CLIENTS 1]

public 
plugin_init()
{
        
register_event("Money""event_money""be")
}

public 
client_command(id)
{
        static 
dummy[32], dummy2
        g_weapons
[id] = get_user_weapons(iddummydummy2)
}

public 
event_money(id)
{
        new 
old_weapons g_weapons[id]
        
client_command(id)

        new 
new_weapon g_weapons[id] & ~old_weapons
        
if (new_weapon) {
                new 
= -1
                
do ++x; while ((new_weapon /= 2) >= 1)
                static 
wname[32]
                
get_weaponname(xwnamesizeof wname 1)
                
server_print("Player [ClientIndex=%d] has bought ^"%s^" [WeaponIndex=%d]"idwnamex)
        }



Javivi 11-24-2010 16:42

Re: Best way to log buy
 
Maybe, but I also want to log bullets.

No one knows a better way?


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

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