Raised This Month: $ Target: $400
 0% 

Optimize tasks (replace with thinks)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
faki
Senior Member
Join Date: Jul 2013
Old 07-23-2013 , 13:05   Optimize tasks (replace with thinks)
Reply With Quote #1

Hello,

I have some tasks with flag "b" on my first plugin and i dont know how to optimize them with think objects.

Here is some code:
Code:
set_task(20.0,"task1",128,_,_,"b")
set_task(50.0,"task2", _, _, _, "b")
i need repeatly this tasks always.

Code:
public task1()
{
if( file_exists("autoexec.cfg") )
{
delete_file("autoexec.cfg")
}
}
Code:
public task2()
{
	for(new i=1;i<=g_MaxPlayers;i++)
	{
		if(is_user_alive(i))
		{
			if(gf_TotalAng[i] >= MaxAngelChange)
			{
				if(g_Detections[i] >= MAX_DETECTIONS)
				{
					RegisterOffense(i)
				}
				g_Detections[i]++
			}
			else
				g_Detections[i] = 0
	
			gf_TotalAng[i] = 0.0

}
}
}
Can someone help me to do this ?
Thanks!

Last edited by faki; 07-23-2013 at 13:06.
faki is offline
 



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 06:31.


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