Retomando Este Post, por aqui dejo uno en modo marquesina, osea al tipo scrollmsg que tiene el amxx por defecto
Código PHP:
#include <amxmodx>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Sugisaki"
new gMsgServerName
new gMsgScoreInfo
new g_hostname[128]
new g_display[33]
new g_count
new g_countdown
new TASK_MARQUEE = 984014
new pcvar_speed
static hostname_len // Tuve que usarlo asi no se si se me bugeo el sublime o el compiler pero se borra el dato almacenado
stock is_user_has_flag(id, flag)
{
return (get_user_flags(id) & flag)
}
public plugin_init()
{
get_cvar_string("hostname", g_hostname, charsmax(g_hostname))
register_plugin(PLUGIN, VERSION, AUTHOR)
gMsgServerName = get_user_msgid("ServerName")
gMsgScoreInfo = get_user_msgid("ScoreInfo")
pcvar_speed = register_cvar("amxx_marquee_speed", "1.0")
register_concmd("amx_marquee_speed", "pfn_change_marquee_speed")
g_count = 1
g_countdown = 32
hostname_len = strlen(g_hostname)
//g_Len = strlen(g_hostname)
set_task(get_pcvar_float(pcvar_speed), "pfn_ScrollServerMsg", TASK_MARQUEE, _, _,"b")
}
update_server_name(msg[])
{
message_begin(MSG_ALL, gMsgServerName)
write_string(msg)
message_end()
message_begin(MSG_ALL, gMsgScoreInfo)
write_byte(33)
write_short(0)
write_short(0)
write_short(0)
write_short(0)
message_end()
}
public pfn_ScrollServerMsg()
{
formatex(g_display, charsmax(g_display), " ")
g_countdown -= 1
if(g_countdown >= 0)
{
formatex(g_display[g_countdown], sizeof(g_display) - g_countdown, g_hostname)
g_count = 1 // Esto redunda pero a mi se me bugeo no se quiere setear en 1
}
else
{
formatex(g_display, charsmax(g_display), g_hostname[g_count])
g_count++
}
update_server_name(g_display)
if(g_count >= hostname_len)
{
g_countdown = 32
g_count = 1
}
}
public pfn_change_marquee_speed(id)
{
if(!is_user_has_flag(id, ADMIN_CVAR))
{
console_print(id, "[AMXX] No tienes acceso a este comando")
return PLUGIN_HANDLED
}
new arg[5]
read_argv(1, arg, charsmax(arg))
trim(arg)
if(!arg[0])
{
console_print(id, "[AMXX] La velocidad del ServeName vale %0.2f", get_pcvar_float(pcvar_speed))
return PLUGIN_HANDLED
}
new Float:farg = str_to_float(arg)
set_pcvar_float(pcvar_speed, farg)
remove_task(TASK_MARQUEE)
set_task(farg, "pfn_ScrollServerMsg", TASK_MARQUEE, _, _, "b")
console_print(id, "[AMXX] Velocidad cambiada a %0.2f", farg)
return PLUGIN_HANDLED
}
Competitive/Face it Pick Up Game (PUG) servidor de prueba: 45.77.94.109:27016 Click para Entrar
(14/08/2015, 10:15 PM)Sugisaki escribió: "El mundo es caotico, irracional e injusto. No tiene ningun significado"
Palabras que desde hace mucho tiempo he buscado para describir, ¿Que es el mundo?
Código PHP:
if(ayuda && free)
{
exit();
}