Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
public plugin_init() {
register_plugin("Auto Healing","1.0","stigma")
register_clcmd("say /heal","autoHeal",0,"Gives a client +3HP for 15 seconds")
register_event("DeathMsg","annouce","a","0")
}
public autoHeal(id) {
new health = get_user_health( id )
if(health >= 50) {
set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 6)
show_hudmessage(id,"Your health have to be below 50!")
}
if(health < 40) {
new sHealth = get_user_health( id ) + 5
new fHealth = 50 - health - 5
set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 3)
show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",sHealth,fHealth)
set_user_health(id, health+5)
set_task(1.0,"autoHeal",id)
return PLUGIN_HANDLED
}
if((health < 50) & (health >= 40)) {
set_user_health(id, health+1)
new slHealth = get_user_health( id )
new fHealth = 50 - health - 1
set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 4)
show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",slHealth,fHealth)
set_task(1.0,"autoHeal",id)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public annouce() {
set_hudmessage(40,100,50, 0.20, 0.30, 2, 0.05, 5.0, 0.01, 0.1, 5)
show_hudmessage(0,"Use /heal to get auto healed until you have 50 hp^nIt would cost you 3000$")
}
into the script, it returns 'bad load'. Anyone who can help me with this problem?
What I want to do is: When a client write /heal - it should cost him 3000$ and I have tryed to make that. But when I do that, it returns bad load...
And also the last function 'annouce'. I want the message to appear every 15 minutes, with a task, but I don't know how I can do that, or actualy, I do know this: I tryed
because I was told that the underscore was like a 'skipper' so it would skip the paraments.