16.08.2015, 20:19
First of all you don't need to do
If the variable has not any value set, it automatically sets it to 0 so
is enough
and
what Dutheil said
and
Your system won't work, if any player leaves it won't remove 1 to the count, so it will just keep adding when a player join, but not remove when a player leaves!
PHP код:
new onlineplayers=0;
PHP код:
new onlineplayers;
and
what Dutheil said
and
Your system won't work, if any player leaves it won't remove 1 to the count, so it will just keep adding when a player join, but not remove when a player leaves!
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
onlineplayers--;
new str[128];
format(str,sizeof(str),"SERVER STATUS: %i players are currently online.",onlineplayers);
SendClientMessageToAll(0xED5F07FF,str);
return 1;
}