Raised This Month: $ Target: $400
 0% 

Sprite edit


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-17-2011 , 06:24   Re: Sprite edit
Reply With Quote #4

id is the player's entity from 1 to 32, 0 is the server.

You don't just hardcode the values because any player can be entity id.

You can toggle sprites on/off using a command for example:

Code:
#include <amxmodx>

new bool:g_bSpr[33]

public plugin_init()
{
    register_message(get_user_msgid("What message ??"), "msg_test")

    register_clcmd("say /test", "cmd_test")
}

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

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

public msg_test(msgid, dest, id)
{
    if(g_bSpr[id])
    {
        // if toggled ON, this code executes when the message triggers for this player
    }
}
Also, get_user_msgid() gets a MESSAGE id, you can't hook sprite files.
__________________
Hunter-Digital 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