AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto heal (https://forums.alliedmods.net/showthread.php?t=11832)

stigma 03-29-2005 12:11

Auto heal
 
Code:
#include <amxmodx> #include <fun> new hpTimer = 15 public plugin_init() {     register_plugin("Auto Healing","1.0","stigma")     register_concmd("healme","autoHeal",0,"Gives a client +3HP for 15 seconds")     register_clcmd("say /heal","autoHeal",0,"Gives a client +3HP for 15 seconds") } public autoHeal(id) {         set_hudmessage(200,0,0, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 2)         if(hpTimer < 0) {                 set_user_health(id,get_user_health(id)) + 3         show_hudmessage(id,"Time before healing stops: %i",hpTimer)                 set_task(1.0,"autoHeal",id)                 return PLUGIN_HANDLED     }         return PLUGIN_HANDLED     }

I dont know whats the matter with this script, but i just cant get it to auto heal me, i dont get any warnings og errors in the compiling part, and all the neccecary modules are loaded... :roll:

Twilight Suzuka 03-29-2005 12:47

WHY THE HELL DO YOU HAVE AN EMPTY ELSE STATEMENT??????

:nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono: :nono:

Look, this is how it should be.

Code:
public auto_heal(id){         new health = get_user_health ( id )         if(health > 100)  return 0;             set_user_health(id, health+4)             set_hudmessage(0,255,0,0.50,0.50,0,6.0,1.0,0.5,0.5,4)     show_hudmessage(id,"+4 hp")     return 1; }

Jesus christ... Read the fucking manual, or the commands list! I didnt update the wiki for nothing.

amxxsean 03-29-2005 12:52

Manual for what? Are you talking about the tutorials?

Twilight Suzuka 03-29-2005 12:55

1. We have a wiki
2. We have documentation
3. SMALL itself has documentation
4. I released a shit load of tutorials and have a lot on hand
5. We have oodles of tutorials on this forum alone.
6. There are small guides littering the internet.

amxxsean 03-29-2005 13:01

Haha, oops, neglected to read the amxx doc scripting tut. Thanks. Where are your tutorials located?

stigma 03-29-2005 16:20

OKay thx...

What does the
Code:
 return 1;
do?

Twilight Suzuka 03-29-2005 16:30

It returns 1.

FeuerSturm 03-29-2005 17:21

Quote:

Originally Posted by Twilight Suzuka
It returns 1.


[offtopic]
lol :lol: :lol: :lol: :lol:

someone's in a bad mood today :wink: [/offtopic]

Twilight Suzuka 03-29-2005 18:20

What? What else do you say to that?

return 1 returns 1 to whatever plugin called it.

FeuerSturm 03-29-2005 18:36

well, if people's questions get tooooo stupid i normally stop replying
to them, prevents me from starting to hate them :D :wink:


All times are GMT -4. The time now is 09:59.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.