View Single Post
Author Message
andre neves
Junior Member
Join Date: Mar 2011
Old 08-23-2011 , 16:50   send any params to native
Reply With Quote #1

I'm creating a plugin, and wanted to put the method colorchat as native, so I used:

.inc
PHP Code:
native print_color_chat(idColor:type, const msg[], any:...) 
plugin:
PHP Code:
public native_print_chat(iPluginiParams)
{
    if( !
get_playersnum() ) return;
    
    new 
idColor:typemsg[256], format_params
    
    id         
get_param(1)
    
type         Color:get_param(2)
    
format_params     get_param(4)
    
get_string(3msg255)
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL:
        {
            
message[0] = 0x01;
        }
        case 
GREEN:
        {
            
message[0] = 0x04;
        }
        default:
        {
            
message[0] = 0x03;
        }
    }
    
formatex(message[1], 255msgformat_params
in this case normal works if I use only one parameter, example:
PHP Code:
print_color_chat(idGREEN"%s""string"
more does not work use this:
PHP Code:
print_color_chat(idGREEN"%s %i""string"integer
how do I send all the parameters?
andre neves is offline