Raised This Month: $ Target: $400
 0% 

Help with a simple script.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 12-02-2007 , 00:12   Re: Help with a simple script.
Reply With Quote #3

The reason why is that ResetHUD is called 2 times after user respawn (approx in 1 sec interval).

You can either do this:

Code:
public HealthOn(id) {     if (!task_exists(id)) set_task(10.0,"Heal",id,"",0,"b")     return PLUGIN_CONTINUE }

or set your healing task from client_connect / client_putinserver, not from respawn event.

UPDATE: You can also remove task on death event:

Code:
public plugin_init()   {     // blah blah     register_event("DeathMsg", "on_shit_happens", "a");     // more blah blah   } public on_shit_happens()   {     new id = read_data(2);     remove_task(id);   }

... but I would use 2. solution.
__________________

Last edited by alien; 12-02-2007 at 00:15.
alien is offline
Send a message via ICQ to alien
 



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 11:07.


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