Quote:
Originally Posted by Alucard^
Hi... i have a trouble with this function....
For example i set:
PHP Code:
cs_set_user_defuse(id, 1, 255, 0, 0)
But when the round end and i respawn the color of defuse back to green =/
I tried with:
PHP Code:
RegisterHam(Ham_Spawn, "player", "PlayerSpawn")
...
public PlayerSpawn(id) cs_set_user_defuse(id, 1, 255, 0, 0)
But nothing.
|
The fact is cs updates players hud after they spawn so, default icon values are restored.
If it's made as in standart half life coding, it is proceeded in UpdateClientData when m_fInitHUD == 1, so the icon will be set back to green after you spawn, or when you execute fullupdate command, or when you make a demo.
Try this :
PHP Code:
#include <amxmodx>
#include <cstrike>
#define VERSION "0.0.1"
public plugin_init()
{
register_plugin("defuser icon color", VERSION, "ConnorMcLeod")
register_event("StatusIcon", "Event_StatusIcon_defuser", "be", "1=1", "2=defuser")
}
public Event_StatusIcon_defuser( id )
{
cs_set_user_defuse(id, 1, 250, 0, 0)
}
__________________