AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   repeating task? (https://forums.alliedmods.net/showthread.php?t=29434)

Chex 06-05-2006 21:29

repeating task?
 
Code:
if(get_user_health(targetid) <= 1)     {         user_silentkill(targetid)         make_deathmsg (id,targetid,0,"Loss of Life")     }     else set_user_health(targetid,get_user_health(targetid)-1)

What would I do to repeat that ever 20 secs? I know to start it would be
Code:
set_task(20.0,???...)
But what would I put in ??? to make it run that function and only that function forever?

wonsae 06-05-2006 21:42

Why not put that in Client_PreThink?

Xanimos 06-05-2006 21:46

Code:
set_task(20.0 , "YourFunc" , PlayerID , _ , _ , "b")
Code:
public YourFunc(id) {     if(get_user_health(id) <= 1)     {         user_silentkill(id)         make_deathmsg (id,id,0,"Loss of Life")     }     else set_user_health(id,get_user_health(id)-1) }

Chex 06-05-2006 23:06

Thank you.


All times are GMT -4. The time now is 16:33.

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