Help with a simple script.
Code:
This plugin is made so a certain user gets the set ammount of HP every 10 seconds, depending on movement speed etc. etc. The problem is, for some reason, when a user dies and respawns, the HP will regain 'TWICE' the speed. For example, User 1 gets hit, he receives a regeneration bonus of 3 hp per 10 seconds for standing still (resting) User 1 dies even with the health regen. User 1 respawns, plays some more and gets hit again... He receives a regeneration bonus of 3 hp per 5 seconds for standing still, and 3 hp more after another 5 seconds. Anyone know how to fix the problem? I tried adding a bool function, but as usual it freaked out on me -.-; Thanks in advance, Dave On a side note, this has no rush at all. I know how to do it so it actually works, but I wanna try stuff this way. |
Re: Help with a simple script.
i'm not a good scripter so i can't really help u but i can give suggestion this might help, not sure if it works, change it alittle
Code:
new bool:g_healCode:
register_event("EventDeath", "Event_Death", "a")Code:
public Event_Death(id) |
Re: Help with a simple script.
The reason why is that ResetHUD is called 2 times after user respawn (approx in 1 sec interval).
You can either do this: Code:
or set your healing task from client_connect / client_putinserver, not from respawn event. UPDATE: You can also remove task on death event: Code:
... but I would use 2. solution. |
Re: Help with a simple script.
Code:
|
Re: Help with a simple script.
Like I said, I wanted to try it with register event.
I already knew how to do it in other ways. No problem anyway. [The plugin has been finished.] |
Re: Help with a simple script.
Quote:
|
Re: Help with a simple script.
What, do you want me to make a second thread for one plugin? >.>;
Quote:
|
| All times are GMT -4. The time now is 11:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.