AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing sprite color (https://forums.alliedmods.net/showthread.php?t=159278)

thomp22 06-15-2011 04:30

Changing sprite color
 
I was trying to make such a plugin that when any user writes a command ie. "amx_power" it changes a certain sprites color for this user only.

So i checked another plugin and it was changing the sprites color like this:
Code:

    #include <amxmodx>
    #include <fakemeta>
 
    ...
 
    new gMsgPowerUp;
 
 
    public plugin_init()
    {
        ...       
 
        gMsgPowerUp = get_user_msgid( "Powerup" );
        register_message( gMsgPowerUp, "Message_Powerup" );
 
        ...
 
    }
 
    public Message_Powerup()
    {
 
        set_msg_arg_int( 2, ARG_BYTE, 255 );
        set_msg_arg_int( 3, ARG_BYTE, 0 );
        set_msg_arg_int( 4, ARG_BYTE, 0 );
    }


How would you change this code to work the way that any user writes "amx_power" and it changes the sprite color for him only?

dias 06-15-2011 09:57

Re: Changing sprite color
 
=> http://wiki.alliedmods.net/Half-Life_1_Game_Events
I don't see "Powerup" in the list of game events...

thomp22 06-15-2011 14:25

Re: Changing sprite color
 
It is in a mod ESF, so i tested that code and it worked, it changed the sprite color to red.

However i would like to understand how can you make this to work the way i described, ie. i write "amx_power" into the console and it changes only my sprite color. Atm it affects every player on the server automatically..


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

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