Raised This Month: $ Target: $400
 0% 

Sprite edit


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
thomp22
Junior Member
Join Date: Feb 2011
Old 06-17-2011 , 09:55   Re: Sprite edit
Reply With Quote #5

It didn't seem to work. It doesn't identify each players but treats them in a similar fashion imo. I use pl[] bool array to see which color to show for each player. But i found out the only value that matters is pl[0] and when it is true, it changes the color for all players vice versa. I wonder what goes wrong? If pl[1] = true then it should change the color only for player1.
Ideas?

Anyway are there other methods to manipulate sprite colors and other values?
Code:
#include <amxmodx>
#include <fakemeta>
#include <amxmisc>

    #define PLUGIN  "ESF color change"
    #define VERSION "1.0"
    #define AUTHOR  "thompsoni"



    
        new gMsgPowerUp;
    new bool:pl[33]
    new i;



    public plugin_init()
    {
        register_plugin( PLUGIN, VERSION, AUTHOR );
        //register_forward( FM_EmitSound, "fw_EmitSound" );
        
    //change color cmd
    register_clcmd("say /test", "cmd_test")


        gMsgPowerUp = get_user_msgid( "Powerup" );
        register_message( gMsgPowerUp, "Message_Powerup" );

    
    
        
    
    for(i=0; i<32; i++)
    {
        pl[i] = false;
    }
    

    }
    

    
public cmd_test(id)
{
    pl[id] = !pl[id] /* assign the variable to it's opossite value, if true, set false, if false, set true. */

    if(pl[id])
    {
        client_print(id, print_chat, "Toggled ON")
    }
    else
    {
        client_print(id, print_chat, "Toggled OFF")
    }
}




    public Message_Powerup(msgid, dest, id)
    {
        
        if( pl[id] )
    {
            set_msg_arg_int( 2, ARG_BYTE, 255 ); 
            set_msg_arg_int( 3, ARG_BYTE, 0 ); 
                set_msg_arg_int( 4, ARG_BYTE, 0 );
    }
    else
    {
        set_msg_arg_int( 2, ARG_BYTE, 255 ); 
            set_msg_arg_int( 3, ARG_BYTE, 0 ); 
                set_msg_arg_int( 4, ARG_BYTE, 255 );
    }



    }
thomp22 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode