24.07.2010, 17:24
Hi since I'm really bored right now, I've made you this :
(Uses Textdraws + Its on top of your radar.)
Merge it in your Gamemode.
If it has some problems, just PM me.
(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;
}
If it has some problems, just PM me.