a mi parecer pienso yo que seria bueno usarlo ^_^, estaria un poco mejor para las personas que usan mucho el stock de chatcolor, en vez de andar poniendo el mismo stock en 50 plugs; Usaremos un solo plugin para los prints en color
su declaracion seria igual como en el registro de la native
al estilo 0, misma declaracion de la native (como aqui arriba)
id = index del user, esto definira el color del team red, blue o grey
msg_type = se usa los MSG_*/ALL/ONE, para todos o a una persona en especifico
msg = el mensaje a enviar
pueden crear una libreria chat_color o como uds quieran o solo agregen arriba de plugin_init()
PD: Simple y pequeño aporte, puede ser que se le tenga que incorporar algunos pequeños ajustes
Código PHP:
#include <amxmodx>
#define PLUGIN "Chat color base"
#define VERSION "1.0"
#define AUTHOR "Sugisaki"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_natives()
{
register_native("chat_color", "native_chat_color", 1)
}
public native_chat_color(id, msg_type, const msg[], any:...)
{
param_convert(3)
new buffer[192]
for(new i = 4 ; i <= numargs() ; i++)
{
param_convert(i)
}
vformat(buffer, charsmax(buffer), msg, 4)
replace_all(buffer, charsmax(buffer), "!t", "^3")
replace_all(buffer, charsmax(buffer), "!n", "^1")
replace_all(buffer, charsmax(buffer), "!g", "^4")
message_begin(msg_type, get_user_msgid("SayText"), {0, 0, 0}, id)
write_byte(id)
write_string(buffer)
message_end()
}
su declaracion seria igual como en el registro de la native
Código PHP:
native chat_color(id, msg_type, const msg[], any:...)
al estilo 0, misma declaracion de la native (como aqui arriba)
id = index del user, esto definira el color del team red, blue o grey
msg_type = se usa los MSG_*/ALL/ONE, para todos o a una persona en especifico
msg = el mensaje a enviar
Código PHP:
#include <amxmodx>
#define PLUGIN "Test Chat color"
#define VERSION "1.0"
#define AUTHOR "Sugisaki"
native chat_color(id, msg_type, const msg[], any:...)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say test", "fw_test")
}
public fw_test(id)
{
chat_color(id, MSG_ONE, "!nYELLOW !t%s !gGREEN", (get_user_team(id) == 1 ? "TT" : "CT") )
}
Código:
; Custom - Add 3rd party plugins here
chat_color_base.amxx
plugin_con_chatcolor.amxx
pueden crear una libreria chat_color o como uds quieran o solo agregen arriba de plugin_init()
Código PHP:
native chat_color(id, msg_type, const msg[], any:...)
PD: Simple y pequeño aporte, puede ser que se le tenga que incorporar algunos pequeños ajustes
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();
}