I'm creating a plugin, and wanted to put the method colorchat as native, so I used:
.inc
PHP Code:
native print_color_chat(id, Color:type, const msg[], any:...)
plugin:
PHP Code:
public native_print_chat(iPlugin, iParams)
{
if( !get_playersnum() ) return;
new id, Color:type, msg[256], format_params
id = get_param(1)
type = Color:get_param(2)
format_params = get_param(4)
get_string(3, msg, 255)
new message[256];
switch(type)
{
case NORMAL:
{
message[0] = 0x01;
}
case GREEN:
{
message[0] = 0x04;
}
default:
{
message[0] = 0x03;
}
}
formatex(message[1], 255, msg, format_params)
in this case normal works if I use only one parameter, example:
PHP Code:
print_color_chat(id, GREEN, "%s", "string")
more does not work use this:
PHP Code:
print_color_chat(id, GREEN, "%s %i", "string", integer)
how do I send all the parameters?