13.06.2009, 12:50
There is no reason to make a timer here.
pawn Код:
#include <a_samp>
new Text:Online;
new PlayersOnline;
new string[100];
public OnFilterScriptInit()
{
for(new i;i<MAX_PLAYERS;i++)
if(IsPlayerConnected) PlayersOnline++;
Online = TextDrawCreate(498.000000, 101.000000, string);
TextDrawAlignment(Online,0);
TextDrawBackgroundColor(Online,0x000000ff);
TextDrawFont(Online,1);
TextDrawLetterSize(Online,0.299999,1.000000);
TextDrawColor(Online,0xffffffff);
TextDrawSetOutline(Online,1);
TextDrawSetProportional(Online,1);
TextDrawSetShadow(Online,1);
format(string,sizeof(string),"~w~Players ~g~Online~w~: %i", PlayersOnline);
return 1;
}
public OnPlayerConnect(playerid)
{
PlayersOnline++;
format(string,sizeof(string),"~w~Players ~g~Online~w~: %i", PlayersOnline);
TextDrawSetString(Online,string);
TextDrawShowForPlayer(playerid, Online);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayersOnline--;
format(string,sizeof(string),"~w~Players ~g~Online~w~: %i", PlayersOnline);
TextDrawSetString(Online,string);
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(Online);
return 1;
}