thxs man, works nicely
it compiles with no errors, what i want to do is only regen above 20ap
so if my armor is 15, it stops the regen
i'm not the best scripter so just do a little check of it as i can't be fucked
getting shot down to less than 20ap just to see if it works
(there was this cool plugin where it drains ur armor first than your health so its like you have 200 hp, i'm trying to do that but having errors, i'll post it later)
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) && !is_user_connected(id)) {
return PLUGIN_CONTINUE
}
if(id != 0) {
new ap = get_user_armor(id)
if(ap >= 100) {
set_user_armor(id , 100)
} else {
ap += 7
if(ap >= 100){
ap = 100
}
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()
}
if(ap <= 20) {
set_user_armor(id, ap)
emit_sound(id,CHAN_VOICE,"ambience/sparks.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_chat, "[AMXX] Your armor can't recharge now")
}
}
return PLUGIN_CONTINUE
}
__________________