Edit the 2 first lines to fit your needs.
PHP Code:
#define PLUGIN_NAME_TO_CALL "StatsX"
#define FUNCTION_TO_CALL "cmdMe"
#include <amxmodx>
#define VERSION "0.0.1"
#define PLUGIN "Auto /me"
new g_iMaxPlayers
#define IsPlayer(%0) ( 1 <= %0 <= g_iMaxPlayers )
new g_iStatsXPluginId, g_iStatsXcmdMeId
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
}
public plugin_cfg()
{
g_iStatsXPluginId = is_plugin_loaded( PLUGIN_NAME_TO_CALL )
if( g_iStatsXPluginId > 0 )
{
g_iStatsXcmdMeId = get_func_id(FUNCTION_TO_CALL, g_iStatsXPluginId)
g_iMaxPlayers = get_maxplayers()
register_event("DeathMsg", "Event_DeathMsg", "a")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
}
}
public Event_DeathMsg()
{
new id = read_data(2)
if( IsPlayer(id) )
{
callme( id )
}
}
public Logevent_Round_End()
{
new players[32], num
get_players(players, num, "ac")
for(--num; num>=0; num--)
{
callme( players[num] )
}
}
callme( id )
{
callfunc_begin_i(g_iStatsXcmdMeId, g_iStatsXPluginId)
callfunc_push_int(id)
callfunc_end()
}
You can also use this :
PHP Code:
#include <amxmodx>
#define VERSION "0.0.1"
#define PLUGIN "Auto /me"
new g_iMaxPlayers
#define IsPlayer(%0) ( 1 <= %0 <= g_iMaxPlayers )
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
g_iMaxPlayers = get_maxplayers()
register_event("DeathMsg", "Event_DeathMsg", "a")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
}
public Event_DeathMsg()
{
new id = read_data(2)
if( IsPlayer(id) )
{
client_cmd( id, "say /me" )
}
}
public Logevent_Round_End()
{
new players[32], num
get_players(players, num, "ac")
for(--num; num>=0; num--)
{
client_cmd( players[num], "say /me" )
}
}
__________________