i'm pretty sure this works but ingame, nothing happens...
what i'm trying to do is have an armour regen which regens ur armour every 4 seconds, and everyone 4 seconds it regens 7 ap with a .wav and the screen having a teal hud
(the precaching part wouldn't be needed to show as i know it will work)
Code:
public client_putinserver(id)
{
if(task_exists(id)) {
remove_task(id)
}
set_task(4.0 , "add_armour" , id , _ , _ , "b")
}
public add_armour(id)
{
if(!is_user_alive(id)) {
return PLUGIN_CONTINUE
}
if(id != 0) {
new ap = get_user_armor(id) + 7)
if(hp >= 100) {
set_user_armor(id , 100)
} else {
set_user_armor(id , ap);
emit_sound(id,CHAN_VOICE,"misc/recharge.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(175)
write_byte(175)
write_byte(75)
message_end()
}
}
return PLUGIN_CONTINUE
}
__________________