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