18.08.2011, 16:54
I hope you already made a textdraw showing how many connected players are there..
pawn Код:
//On top of your script (Global Var)
new g_ConnectedPlayers;
//Default functions:
public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid)) g_ConnectedPlayers++;
UpdatePlayersTextDraw();
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(!IsPlayerNPC(playerid)) g_ConnectedPlayers--;
UpdatePlayersTextDraw();
return 1;
}
//new stock function, put it anywhere outside other functions
stock UpdatePlayersTextDraw()
{
new players[32];
format(players, sizeof players, "Players: %i/100", g_ConnectedPlayers);
TextDrawSetString(/* TextDraw Name */, players);
}