I can't make it work. I want to flash the victim after 4 seconds repitedly.
PHP Code:
public admin_flash(id,level,cid) {
if (!cmd_access(id,level,cid,2)) {
return PLUGIN_HANDLED
}
new victim[32]
read_argv(1,victim,31)
new player = cmd_target(id,victim,0)
if (!player) return PLUGIN_HANDLED
set_task(2.0,"Flash",player,"b")
}
public Flash(id) {
message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id)
write_short( 1<<15 )
write_short( 1<<10 )
write_short( 1<<12 )
write_byte( 255 )
write_byte( 255 )
write_byte( 255 )
write_byte( 255 )
message_end()
emit_sound(id,CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
}