Raised This Month: $ Target: $400
 0% 

I have 2 questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-28-2007 , 10:08   Re: I have 2 questions
Reply With Quote #6

Here you go:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new g_attack[33];

public plugin_init()
{
    register_forward(FM_PlayerPreThink, "fm_playerthink", 1)
    set_task(2.0, "display_attack_num", 110477, "", 0, "b")
}

public fm_playerthink(id)
{
    if((pev(id, pev_button) & IN_ATTACK) && !(pev(id, pev_oldbuttons) & IN_ATTACK))
    {
        // do something
        g_attack[id]++;
    }
}

public display_attack_num()
{
    new playercount, Players[32]
    get_players(Players, playercount,"a")
    for (new i=0; i < playercount; ++i)
    {
        client_print(Players[i], print_chat, "attacks: %d", g_attack[Players[i]])
    }
}

+karma would be nice! ;)
__________________
regalis is offline
 



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 10:41.


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