Server Status (Players Online[xx])
#5

Hi since I'm really bored right now, I've made you this :
(Uses Textdraws + Its on top of your radar.)

pawn Код:
#include <a_samp>

new Text:TotalPlayersTD;
new totalOnline;

public OnGameModeInit()
{
  TotalPlayersTD = TextDrawCreate(35.000000,320.000000,"Test Server ( Players Online)");
  TextDrawAlignment(TotalPlayersTD,0);
  TextDrawBackgroundColor(TotalPlayersTD,0x000000ff);
  TextDrawFont(TotalPlayersTD,1);
  TextDrawLetterSize(TotalPlayersTD,0.299999,1.000000);
  TextDrawColor(TotalPlayersTD,0x0000ffff);
  TextDrawSetOutline(TotalPlayersTD,1);
  TextDrawSetProportional(TotalPlayersTD,1);
  TextDrawSetShadow(TotalPlayersTD,1);
  SetTimer("TotalConnect", 1000, true);
  return 1;
}

public OnPlayerConnect(playerid)
{
  totalOnline++;
  return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  totalOnline--;
  return 1;
}

public OnPlayerSpawn(playerid)
{
  TextDrawShowForPlayer(playerid, TotalPlayersTD);
  return 1;
}


forward TotalConnect(playerid);
public TotalConnect(playerid)
{
   new string[126];
   format(string, sizeof(string), "%s Server (%d Players Online)", GetServerHostName(), totalOnline);
   TextDrawSetString(TotalPlayersTD, string);
   return 1;
}




stock GetServerHostName()
{
   new string[106];
   GetServerVarAsString("hostname", string, sizeof(string));
   return string;
}
Merge it in your Gamemode.

If it has some problems, just PM me.
Reply


Messages In This Thread
Server Status (Players Online[xx]) - by gieende - 24.07.2010, 14:07
Re: Server Status (Players Online[xx]) - by Wulffe - 24.07.2010, 14:22
Re: Server Status (Players Online[xx]) - by gieende - 24.07.2010, 16:40
Re: Server Status (Players Online[xx]) - by Carlton - 24.07.2010, 16:58
Re: Server Status (Players Online[xx]) - by ViruZZzZ_ChiLLL - 24.07.2010, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)