Server Status (Players Online[xx]) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server Status (Players Online[xx]) (
/showthread.php?tid=162713)
Server Status (Players Online[xx]) -
gieende - 24.07.2010
Hello.
Please write a script that will show players online.
This would look like this:
http://rp-pl.net/ - In menu "Graczy Online (47)"
That script is simple, but very important for me.
Re: Server Status (Players Online[xx]) -
Wulffe - 24.07.2010
This is not a gift shop.
Try you self, and then ask for help later - Show us your work, so we can tell you what wrong/right.
In that way you hopefully will understand how to do next time.
Re: Server Status (Players Online[xx]) -
gieende - 24.07.2010
please help
Re: Server Status (Players Online[xx]) -
Carlton - 24.07.2010
https://sampforum.blast.hk/showthread.php?tid=118885
Re: Server Status (Players Online[xx]) -
ViruZZzZ_ChiLLL - 24.07.2010
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.