Код
#include <amxmodx>
// Player var
new g_Count;
public plugin_init()
{
// Register Plugin
register_plugin("Players Online", "1.4", "Equali")
// Hook Say
register_clcmd("say","handle_say")
}
public client_putinserver(id)
{
// increase player var
g_Count++
}
public client_disconnect(id)
{
// decreased player var
g_Count--
}
public handle_say(id)
{
static Args[ 10 ]
read_args(Args, 9)
remove_quotes(Args)
if(Args[0] == '/' && containi(Args, "online") != -1)
{
client_print( id , print_chat, "Игроков Онлайн: %i" , g_Count)
return 1; // block /online
}
return 0;
}
Код
#include <amxmodx>
#define PLUGIN "HP vision"
#define VERSION "1.0"
#define AUTHOR "apprentice"
new hudsync;
new maxplayers;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event( "ResetHUD", "eResetHUD", "be" );
hudsync = CreateHudSyncObj();
maxplayers = get_maxplayers();
set_task(0.1, "stats", 0, "", 0, "b", 0);
}
public eResetHUD( id )
{
if( !is_user_bot( id ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Crosshair" ), _, id );
write_byte( 0 );
message_end();
}
}
public stats()
{
for(new i = 1; i <= maxplayers; i++)
{
set_hudmessage(255, 230, 0, -2, 0.91, 0, 6.0, 12.0);
ShowSyncHudMsg(i, hudsync , " Health: %d HP", get_user_health(i));
}
}
Суть в том, что нужно сделать так, чтоб онлайн показывало на месте плагина
hp_vision и чтоб оно всегда там было, не вводя комманду /online
На картинки ниже всё показано:
Красная полоска, нужна убрать.
Зелёная, поставить на то месть...
Отредактировал: -=pypsic=-, - 4.1.2011, 12:26