Please help with players online counter
#5

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;
}
Reply


Messages In This Thread
Please help with players online counter - by AiVAMAN - 13.06.2009, 12:17
Re: Please help with players online counter - by miokie - 13.06.2009, 12:19
Re: Please help with players online counter - by AiVAMAN - 13.06.2009, 12:29
Re: Please help with players online counter - by [NL]Bank - 13.06.2009, 12:41
Re: Please help with players online counter - by CracK - 13.06.2009, 12:50
Re: Please help with players online counter - by [NL]Bank - 13.06.2009, 12:51
Re: Please help with players online counter - by CracK - 13.06.2009, 12:52
Re: Please help with players online counter - by [NL]Bank - 13.06.2009, 12:53

Forum Jump:


Users browsing this thread: 2 Guest(s)