AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making draining/healing loop... FINALLY fixed it, MYSELF... (https://forums.alliedmods.net/showthread.php?t=51476)

Davidos 02-18-2007 15:08

Making draining/healing loop... FINALLY fixed it, MYSELF...
 
I am trying to make these lines

Code:
    new health2 = get_user_health(target)     new newhealth = health + 2     new newhealthz = health2 - 2     set_user_health(id,newhealth)     set_user_health(target,newhealthz)
loop, so that it keeps doing that till it's forced to stop

using it in this plugin


**** NOTE TO SELF ****
MSG_ONE_UNRELIABLE FOR TEH WIEN! <so THAT'S why it kept crashing... thank's rob...>

Code:
    set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,100)     set_user_rendering(target,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,50)     message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id);     write_short(~0);     write_short(~0);     write_short(1<<12);     write_byte(200);     write_byte(0);     write_byte(0);     write_byte(30);     message_end();     message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},target);     write_short(~0);     write_short(~0);     write_short(1<<12);     write_byte(200);     write_byte(0);     write_byte(0);     write_byte(30);     message_end();     set_user_maxspeed(id, 1.0)     set_user_maxspeed(target,1.0)     new health2 = get_user_health(target)     new newhealth = health + 2     new newhealthz = health2 - 2     set_user_health(id,newhealth)     set_user_health(target,newhealthz)     return PLUGIN_HANDLED

oh and, new health is already defined so you don't have to worry about that...

Anyone have an idea how to do that?

frankly it works but it only does it one time instead of keep doing it.

The plugin is being used in a command < say /drain>

XxAvalanchexX 02-18-2007 17:34

Re: Making draining/healing loop...
 
set_task

Davidos 02-18-2007 17:44

Re: Making draining/healing loop...
 
Quote:

Originally Posted by XxAvalanchexX (Post 442205)

Hmm, I thought that made it loop every time, command on or off...

EDIT:

Sorry I was sleepy yesterday, thanks anyway.

I already got the answer through pm. Still + karma cuz I don't care.

Davidos 02-19-2007 04:45

Re: Making draining/healing loop...
 
Damnit I fixed it myself, nevermind. When I get GHW's accpt's I will post this in release...

Nevermind that last bit I made my own script, cuz he was too lazy to help me. Bye kids.


All times are GMT -4. The time now is 00:35.

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