Raised This Month: $ Target: $400
 0% 

MOTD questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-19-2009 , 09:27   Re: MOTD questions
Reply With Quote #2

Untested, uncompiled (the web compiler seems to be broken and also missing charsmax).

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

new gMaxPlayers

new gHeadshots[33]
new 
gUniqueID[33]

public 
plugin_init()
{
    
register_plugin"Stats MOTD""1.0""Hawk552" )

    
register_event"HLTV""EventHLTV""a""1=0""2=0" )
    
register_event"DeathMsg""EventDeathMsg""a" )

    
gMaxPlayers get_maxplayers()
}

public 
EventHLTV()
    for ( new 
1len<= gMaxPlayersi++ )
        if ( 
is_user_alive) )
        {
            static 
MOTD[4096]
            
len formatexMOTDcharsmaxMOTD ), "Kills: %d<br>"get_user_frags) )
            
len += formatexMOTD[len], charsmaxMOTD ) - len"Deaths: %d<br>"get_user_deaths) )
            
len += formatexMOTD[len], charsmaxMOTD ) - len"Headshots: %d"gHeadshots[i] )

            
show_motdiMOTD"Stats" )
        }

public 
EventDeathMsg()
{
    new 
attacker read_data)
    if ( 
<= attacker <= gMaxPlayers && read_data) )
    {
        new 
uniqueID get_user_useridattacker )
        if ( 
uniqueID != gUniqueID[attacker] )
        {
            
gHeadshots[attacker] = 0
            gUniqueID
[attacker] = uniqueID
        
}

        
gHeadshots[attacker]++
    }

__________________

Last edited by Hawk552; 10-19-2009 at 10:26.
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 17:38.


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