When I chat /heroin i got a error "Host_Error WriteDest_Parm not a client"
And this is my code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "HEROIN"
#define VERSION "1.0"
#define AUTHOR "VINAGHOST"
#define HRI 156
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /heroin", "buyheroin");
register_clcmd("say_team /heroin", "buyheroin");
}
public buyheroin(id)
{
if( !is_user_alive(id))
{
client_print(id,print_chat, "You died ==!")
return PLUGIN_CONTINUE;
}
if( cs_get_user_money(id) < 10000 )
{
client_print(id,print_chat, "You don't have enough money ==")
return PLUGIN_CONTINUE;
}
cs_set_user_money(id, cs_get_user_money(id) - 10000)
new di[1]
di[0] = id
set_task(10.0, "shake", HRI + id, di,1,_,1)
return PLUGIN_HANDLED
}
public shake(di[])
{
new id = str_to_num(di)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), {0,0,0}, id) // Shake Screen
write_short(1<<14)
write_short(1<<14)
write_short(1<<14)
message_end()
}
public client_connect(id)
{
remove_task(HRI + id)
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
remove_task(HRI + id)
return PLUGIN_HANDLED
}
public death()
{
new id = read_data(2)
remove_task(HRI + id)
}
so how could I repeat shaking screen player ?
Sorry for my bad English ._.