Raised This Month: $ Target: $400
 0% 

having problems with set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-24-2006 , 17:24  
Reply With Quote #1

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
__________________
~~~~~Hawk~~~~~
Werewolf is offline
Reply



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 16:36.


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