17.08.2009, 01:33
Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
Basically it's a tick function. That's how I see it anyway. |
Quote:
Originally Posted by cyber_punk
in depth tutorial on HOW TO USE it,
|
pawn Код:
new g_PlayerTick[ MAX_PLAYERS ] = { 999, 999, ... }; // Create an array of ticks for each player and set them ALL to 999.
public OnPlayerUpdate( playerid )
{
g_PlayerTick[ playerid ] --; // Decrease player ticks for the updating player by one on every update.
if ( !g_PlayerTick[ playerid ] ) // If the players ticks for the updating player are equal to 0 then we can execute what function we wish to...
{
BanEx( playerid, "Using my bandwidthz" ); // Banning the updating player for using your bandwidth
g_PlayerTick[ playerid ] = 999; // Reset the tick counter for the updating player to the original number once the ticks have run out. This allows us to start counting down again
}
}
Use multiple tick counters for best effect, it will help balance the CPU load. So what I mean is don't try to run lots of code under one tick updater, try to use multiple tick updaters so you don't get a huge load at one time.
*code not tested, but should work. It serves as a logical explanation, not necessarily a working one..
Hope this helps.