Raised This Month: $ Target: $400
 0% 

Changing sprite color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thomp22
Junior Member
Join Date: Feb 2011
Old 06-15-2011 , 04:30   Changing sprite color
Reply With Quote #1

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?
thomp22 is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 06-15-2011 , 09:57   Re: Changing sprite color
Reply With Quote #2

=> http://wiki.alliedmods.net/Half-Life_1_Game_Events
I don't see "Powerup" in the list of game events...
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
thomp22
Junior Member
Join Date: Feb 2011
Old 06-15-2011 , 14:25   Re: Changing sprite color
Reply With Quote #3

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..

Last edited by thomp22; 06-16-2011 at 12:18.
thomp22 is offline
Old 06-16-2011, 12:19
thomp22
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Reply



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:35.


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