AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   having problems with set_task (https://forums.alliedmods.net/showthread.php?t=25967)

wouter 03-24-2006 17:16

having problems with set_task
 
i dont get it, i know it must look like this set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 ) but i dont know how to fill it in :oops: i need to keep repeating the function "cmd_info" evry 300.0 sec with flag "b"

Werewolf 03-24-2006 17:24

OK. Here is an example copied from my Naruto hero on superhero mod forums. (Alias: Berserker on sh mod forums)

Code:
set_task(1.0,"naru_loop",0,"",0,"b" )

And here it is a task that is repeated every second. This is from a heal code like Wolverine. Also on sh mod forums.

Here is the thing it is calling. (naru_loop)
Code:
public naru_loop() {           if (!shModActive()) return         new HealPoints = get_cvar_num("naru_hppersec")         for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {         if (  gHasNarutoPowers[id] && is_user_alive(id) )   {             shAddHPs(id, HealPoints, gPlayerMaxHealth[id] )         }     } }

You don't have to care about the last code that I posted but I wanted to show an example.
Did that solve your problem?
Code:
new currentkarma = get_user_karma(id) new addkarma = 1 if(did_solve_problem(id)) { set_user_karma(id, currentkarma + addkarma) return PLUGIN_CONTINUE }
Hehe. Just kidding :lol:

wouter 03-25-2006 08:40

k, thx for the example (your karma script is activated xD )


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

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