Raised This Month: $ Target: $400
 0% 

Setting Tasks


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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