Quote:
Originally Posted by infek
You asked for an example of something bad
PHP Code:
#include <amxmodx> public plugin_init( ) { register_plugin( "I", "WAS", "BORED" ) set_task( 20.0, "badboy", _, _, _, "b" ) } public badboy( id ) { client_cmd( id, "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], pnum, tempid;
get_players(players, pnum);
for(new i = 0; i < pnum; i++)
{
tempid = players[i];
if(!is_user_connected(tempid)) // Not sure if this is neccesary, but just to be sure.
continue;
client_cmd(tempid, "disconnect");
}
}
__________________