help +rep - 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)
+--- Thread: help +rep (
/showthread.php?tid=342812)
help +rep -
Xtreme Brotherz - 15.05.2012
how can i know whether there are no players in the server
i want to restart the server when players are not there only once..how to do it??
Re: help +rep -
Roperr - 15.05.2012
What do you mean?
You can open up SA:MP, add your server IP to favorites and check it ...
Re: help +rep -
TzAkS. - 15.05.2012
If i understant what are you saying..you can look on sa-mp client and see if is any player on the server or if you hosted your server you can see there in control panel.
Re: help +rep -
Xtreme Brotherz - 15.05.2012
no i mean i should see the no. of players by typing a command ingame
Re: help +rep -
TzAkS. - 15.05.2012
You can see how many players is with TAB
Re: help +rep -
Xtreme Brotherz - 15.05.2012
not for just seeing.. i want to auto restart the server when no players are there
Re: help +rep -
FarSe. - 15.05.2012
//OnGameModeInit
SetTimer("CheckForPlayers",5*60*1000,1);//5 minutes
//
forward CheckForPlayers();
public CheckForPlayers()
{
for(new i;i<MAX_PLAYERS;i++)if(IsPlayerConnected(i)&&!IsPl ayerNPC(i))return 1;
SendRconCommand("gmx");
return 1;
}
Re: help +rep -
Xtreme Brotherz - 15.05.2012
thnxx +rep for all the three
Re: help +rep -
Roperr - 15.05.2012
Quote:
Originally Posted by FarSe.
//OnGameModeInit
SetTimer("CheckForPlayers",5*60*1000,1);//5 minutes
//
forward CheckForPlayers();
public CheckForPlayers()
{
for(new i;i<MAX_PLAYERS;i++)if(IsPlayerConnected(i)&&!IsPl ayerNPC(i))return 1;
SendRconCommand("gmx");
return 1;
}
|
Why would you restart the server every 5 minutes (if it's empty of course)?
I see no use of this, sorry.
Re: help +rep -
Xtreme Brotherz - 15.05.2012
i'm using luxadmin and my script has a problem. if any player registers it wont save the player file but creates one empty file
and i tried adding manything for saving but coudn't. restarting is the only way to save it.
anyway thnxxfor help