24.01.2015, 22:32
Puedes hacerlo de varias formas, una:
o
y la funciуn estб ahн.
pawn Код:
new UsersOnline;
public OnPlayerConnect(playerid)
{
UsersOnline++;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
UsersOnline--;
return 1;
}
pawn Код:
new Logeado[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Logeado[playerid] = true;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Logeado[playerid] = false;
return 1;
}
stock GetPlayersOnline()
{
new _c;
for(new i; i != MAX_PLAYERS; i++)
{
if(!Logeado[i] || !IsPlayerConnected(i))
continue;
_c++;
}
return _c;
}