Raised This Month: $ Target: $400
 0% 

Auto heal


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 03-29-2005 , 12:11   Auto heal
Reply With Quote #1

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...
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-29-2005 , 12:47  
Reply With Quote #2

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



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.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
amxxsean
Member
Join Date: Feb 2005
Old 03-29-2005 , 12:52  
Reply With Quote #3

Manual for what? Are you talking about the tutorials?
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-29-2005 , 12:55  
Reply With Quote #4

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.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
amxxsean
Member
Join Date: Feb 2005
Old 03-29-2005 , 13:01  
Reply With Quote #5

Haha, oops, neglected to read the amxx doc scripting tut. Thanks. Where are your tutorials located?
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 03-29-2005 , 16:20  
Reply With Quote #6

OKay thx...

What does the
Code:
 return 1;
do?
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-29-2005 , 16:30  
Reply With Quote #7

It returns 1.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 03-29-2005 , 17:21  
Reply With Quote #8

Quote:
Originally Posted by Twilight Suzuka
It returns 1.

[offtopic]
lol

someone's in a bad mood today [/offtopic]
FeuerSturm is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-29-2005 , 18:20  
Reply With Quote #9

What? What else do you say to that?

return 1 returns 1 to whatever plugin called it.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 03-29-2005 , 18:36  
Reply With Quote #10

well, if people's questions get tooooo stupid i normally stop replying
to them, prevents me from starting to hate them
FeuerSturm is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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