help +rep
#1

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??
Reply
#2

What do you mean?

You can open up SA:MP, add your server IP to favorites and check it ...
Reply
#3

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.
Reply
#4

no i mean i should see the no. of players by typing a command ingame
Reply
#5

You can see how many players is with TAB
Reply
#6

not for just seeing.. i want to auto restart the server when no players are there
Reply
#7

//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;
}
Reply
#8

thnxx +rep for all the three
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)