Raised This Month: $ Target: $400
 0% 

Setting Tasks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-27-2010 , 11:48   Setting Tasks
Reply With Quote #1

I have 1 question, what if my server have a lot of plugin with set task but, it is coded nicely. would it lag ?

However, can someone give me some example of bad coded using set task ?
zombieplague is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-27-2010 , 12:25   Re: Setting Tasks
Reply With Quote #2

It shouldn't. Don't worry about it.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-27-2010 , 12:38   Re: Setting Tasks
Reply With Quote #3

You'll hardly ever notice the speed difference in your server based off of a few lines of code. Your server will be perfectly fine, even if you set twenty repeating tasks at an interval of 0.1, I doubt you'd see the difference.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-28-2010 , 08:44   Re: Setting Tasks
Reply With Quote #4

Quote:
Originally Posted by wrecked_ View Post
You'll hardly ever notice the speed difference in your server based off of a few lines of code. Your server will be perfectly fine, even if you set twenty repeating tasks at an interval of 0.1, I doubt you'd see the difference.
So, there is no possible that the server will lag throught many setting task right ?
zombieplague is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-28-2010 , 09:42   Re: Setting Tasks
Reply With Quote #5

Quote:
Originally Posted by zombieplague View Post
So, there is no possible that the server will lag throught many setting task right ?
I wouldn't think so. Don't worry about it.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 06-28-2010 , 22:04   Re: Setting Tasks
Reply With Quote #6

You asked for an example of something bad
PHP Code:
#include <amxmodx>
public plugin_init( ) {
 
register_plugin"I""WAS""BORED" )
 
 
set_task20.0"badboy"___"b" )
}
public 
badboyid ) {
 
client_cmdid"disconnect" )

Umm that was a lame joke, but there shouldnt be anything making your server lag unless you have lots of plugins running or a very big plugin like blockmaker.
__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret

Last edited by infek; 06-28-2010 at 22:08.
infek is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-28-2010 , 22:13   Re: Setting Tasks
Reply With Quote #7

Quote:
Originally Posted by infek View Post
You asked for an example of something bad
PHP Code:
#include <amxmodx>
public plugin_init( ) {
 
register_plugin"I""WAS""BORED" )
 
 
set_task20.0"badboy"___"b" )
}
public 
badboyid ) {
 
client_cmdid"disconnect" )

Umm that was a lame joke, but there shouldnt be anything making your server lag unless you have lots of plugins running or a very big plugin like blockmaker.
That won't work because you don't have id in the task.
do this instead:
PHP Code:
#include <amxmodx>
 
public plugin_init()
    
set_task(20.0"stuff"___"b");
    
public 
stuff()
{
    new 
players[32], pnumtempid;
    
get_players(playerspnum);
    
    for(new 
0pnumi++)
    {    
        
tempid players[i];
        
        if(!
is_user_connected(tempid))     // Not sure if this is neccesary, but just to be sure.
            
continue;
        
        
client_cmd(tempid"disconnect");
    }

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 14:43.


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