HLMOD.HU Forrás Megtekintés
- www.hlmod.hu#include < amxmodx >
#include < amxmisc >
new g_pHostName, g_iMsgServerName;
public plugin_init( ) {
register_plugin( "amx_hostname", "1.0", "xPaw" );
register_clcmd( "amx_hostname", "CmdHostName", ADMIN_CFG, "<hostname>" );
g_iMsgServerName = get_user_msgid( "ServerName" );
g_pHostName = get_cvar_pointer( "hostname" );
}
public CmdHostName( const id, const iLevel, const iCid ) {
if( !cmd_access( id, iLevel, iCid, 1 ) )
return PLUGIN_HANDLED;
new szHostName[ 64 ];
if( read_argc( ) == 1 ) {
new name[33]
get_user_name(id, name, 32)
print_color(0, "!t[Info]!y %s!g Frisstette a szerver nevt.",name );
get_pcvar_string( g_pHostName, szHostName, 63 );
} else {
read_argv( 1, szHostName, 63 );
set_pcvar_string( g_pHostName, szHostName );
new name[33]
get_user_name(id, name, 32)
print_color(0, "!t[Info]!y %s!g Megvltoztatta a szerver nevt!!t A szerver j neve:!y %s",name, szHostName );
}
message_begin( MSG_BROADCAST, g_iMsgServerName );
write_string( szHostName );
message_end( );
return PLUGIN_HANDLED;
}
stock print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "", "á")
replace_all(msg, 190, "", "é")
replace_all(msg, 190, "", "í")
replace_all(msg, 190, "", "ó")
replace_all(msg, 190, "", "ö")
replace_all(msg, 190, "", "ő")
replace_all(msg, 190, "", "ú")
replace_all(msg, 190, "", "ü")
replace_all(msg, 190, "", "ű")
replace_all(msg, 190, "", "Á")
replace_all(msg, 190, "", "É")
replace_all(msg, 190, "", "Í")
replace_all(msg, 190, "", "Ó")
replace_all(msg, 190, "", "Ö")
replace_all(msg, 190, "", "Ő")
replace_all(msg, 190, "", "Ú")
replace_all(msg, 190, "", "Ü")
replace_all(msg, 190, "", "Ű")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
return PLUGIN_HANDLED
}