 |
|
BANNED
Join Date: Oct 2009
Location: Land(IND)
|

10-19-2009
, 10:22
Re: MOTD questions
|
#3
|
Quote:
Originally Posted by Hawk552
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 i = 1, len; i <= gMaxPlayers; i++ ) if ( is_user_alive( i ) ) { static MOTD[4096] len = formatex( MOTD, charsmax( MOTD ), "Kills: %d<br>", get_user_frags( id ) ) len += formatex( MOTD[len], charsmax( MOTD ) - len, "Deaths: %d<br>", get_user_deaths( id ) ) len += formatex( MOTD[len], charsmax( MOTD ) - len, "Headshots: %d", gHeadshots[id] )
show_motd( i, MOTD, "Stats" ) }
public EventDeathMsg() { new attacker = read_data( 1 ) if ( 1 <= attacker <= gMaxPlayers && read_data( 3 ) ) { new uniqueID = get_user_userid( attacker ) if ( uniqueID != gUniqueID[attacker] ) { gHeadshots[attacker] = 0 gUniqueID[attacker] = uniqueID }
gHeadshots[attacker]++ } }
|
id is missing in public EventHLTV() that i ve added it
but when motd will appear..i also need name beside kills,headshots and death....and when it will appear can u make by adding that when clients type /kills than motd appear
|
|
|
|