[Ajuda] Msg server full.
#1

Pessoal alguйm pode me ajudar com um code?
Ъltimamente andei criando vбrios tуpicos aqui, й o seguinte, quando o servidor ficar lotado dar uma mensagem: Uhul, servidor lotado! Sу que jб tentei de vбrias maneiras, um amigo me passou um cod. sу que nгo funfou, alguйm pode me ajudar a construir um?
Reply
#2

pawn Код:
for(new i ; i < MAX_PLAYERS; ++i)
{  
    if(IsPlayerConnected(i))
    {
        if(GetMaxPlayers() == i)
        {
        }
    }
}

net do celular й foda!
Reply
#3

pawn Код:
#define SLOTS 50
pawn Код:
public OnPlayerConnect(playerid)
{
  if(SLOTS >= 50) return format(string, sizeof(string), "[SERVIDOR] Servidor Lotado → %d Players Online", SLOTS); SendClientMessageToAll(0x2641FEAA, string);
  return 1;
}
Acho que й isso *-* Fiz na pressa ^^
Reply
#4

Garfield isso jб possui no meu GameMode, sу nгo sei fazer a aзгo.

ShickCard nгo estб dando ele estб bugando, jб entro no servidor nem aparece o login box e jб comeзo falando aovivo. \o/
Reply
#5

pawn Код:
new g;
for(new i ; i < MAX_PLAYERS; ++i)
{  
    if(IsPlayerConnected(i))
    {
         g++;
    }
}
if(g >= GetMaxPlayers())
{
      SendClientMessageToAll(0x00FF00,"Foi Badido novo record");
}
Reply
#6

Aff tenta.

pawn Код:
#define SLOTS 50 // MUDE PARA A QUANTIDADE DE SLOTS DO SEU SERVER
new playersonline = 0;
pawn Код:
public OnPlayerConnect(playerid)
{
 new lol[40];
 for(new i=0; i<GetMaxPlayers; i++)
 {
    playersonline++;
    format(lol, sizeof(lol), "[SERVIDOR] {41FEAA}Servidor {AAAAAA}Lotado (%d/%d)", playersonline, SLOTS);
    SendClientMessageToAll(0xD5E8A8AA, lol);
 }
 return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
   new str[35];
   playersonline--;
   format(str, sizeof(str), "[SERVIDOR] Players Online (%d/%d)", playersonline, SLOTS);
   SendClientMessageToAll(0xD5E8A8AA, str);
   return 1;
}
Reply
#7

pawn Код:
static g;
for(new i ; i < MAX_PLAYERS; ++i)
{  
    if(IsPlayerConnected(i))
    {
           g++;
    }
}
if(g == GetMaxPlayers())
{
      SendClientMessageToAll(0x00FF00,"Foi Batido novo record");
}
Geito fбcil prбtico,
a variбvel I й o ъmero de players Online,
e a funзгo GetMaxPlayers
Pega o Mбximo de players(slots) do servidor.

entгo:

Se os players conectados sгo igual a o nъmero dos slots,
ele manda a mensagem.

eu adicionei a varбvel stбtica G para nгo ficar flodando a msg.
Reply
#8

Shick mesmo erro.

Garfield coloquei em
pawn Код:
public OnPlayerConnect(playerid)
e nгo deu em nada, tentei "enfiltrar" dentro de um que eu ja tinha aн deu sу que sу pega apуs digitar o comando, nгo й dessa forma que bem pretendo e sim lanзar altomaticamente apуs o servidor ficar full.
='(
Reply
#9

WTF?
Tenta algo assim

pawn Код:
if(SLOTS >= GetMaxPlayers)
Reply
#10

Dб os seguintes dois erros:
Код:
D:\TOP\gamemodes\BFG.pwn(6567) : error 076: syntax error in the expression, or invalid function call
Linhas:

pawn Код:
if(SLOTS >= GetMaxPlayers)
    {
    new lol[40];
    for(new i=0; i<SLOTS; i++)
    {
    playersonline++;
    format(lol, sizeof(lol), "[SERVIDOR] {41FEAA}Servidor {AAAAAA}Lotado (%d/%d)", playersonline, SLOTS);
    SendClientMessageToAll(0xD5E8A8AA, lol);
    }
    return 1;
}
Linha: 6567
pawn Код:
if(SLOTS >= GetMaxPlayers)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)