[Ajuda] Ver Player Em Virtual World.
#1

Como Faзo Um Comando De Ver Os Player Online Nas Virtuais World, Ex:

pawn Код:
CMD:sala0(playerid, params[])
{
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "Bem Vindo a Sala Numero: 0.");
    return true;
}

CMD:sala1(playerid, params[])
{
    SetPlayerVirtualWorld(playerid, 1);
    SendClientMessage(playerid, -1, "Bem Vindo a Sala Numero: 1.");
    return true;
}
e Agora Um Comando Que Da Pra Ver Os Players, Ex:

pawn Код:
CMD:playerssala2(playerid, params[])
{
    SendClientMessage(playerid, -1, "Tem %s Na Sala 2.");
    return true;
}
CMD:playerssala1(playerid, params[])
{
    SendClientMessage(playerid, -1, "Tem %s Na Sala 1.");
    return true;
}
Reply
#2

GetPlayerVirtualWorld
Reply
#3

PHP код:
new CounterSala1;
new 
CounterSala2;
CounterSala1++; // quando alguйm entra na sala 1
CounterSala2++; // quando alguйm entra na sala 2
CounterSala1--; // quando alguйm sai da sala 1
CounterSala2--; // quando alguйm sai da sala 2
CMD:salas(playeridparams[])
{
    new 
string[128];
    
    
format(stringsizeof(string), "Pessoas na sala 1: %d |==| Pessoas na sala 2: %d"CounterSala1CounterSala2);
    
SendClientMessage(playerid, -1string);
    
    return 
1;

E tambйm aconselho:

Scripting Basics_PT
Reply
#4

pawn Код:
CMD:playerssala1(playerid, params[])
{
    new stringpt[128], numerodp;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
            numerodp ++;
    }
    format(stringpt, sizeof(stringpt), "Tem %d Na Sala 1.", numerodp);
    SendClientMessage(playerid, -1, stringpt);
    return true;
}
acho que funcionara.
Reply
#5

Por padrгo o Virtual World inicial й 0.

Para que usuбrios consigam se "ver" basta setar o virtual world de um jogador par o mesmo do outro.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)