[AJUDA] Random player.
#2

pawn Код:
forward ReturnRandomID();
public ReturnRandomID()
{
    for(new i=0 i<9999999999; i++)
    {
        new rand = random(MAX_PLAYERS);
        if(rand != INVALID_PLAYER_ID)
        return rand;
    }
    return 1;
}
to com dor de cabeзa de tanto codar hj entao fiz isso sem usar 1 neuronio.

ps: muda seu MAX_PLAYERS pra o numero de slots do seu sv, ou o numero maximo de players q seu sv atinge (um numero seguro) ai o teste fica mais eficaz e seu sv fica mais optimizado (vai dar ate pra ver no .amx o tamanho do arquivo)

nossa vei meu comando com for ficou um anus...

pawn Код:
forward ReturnRandomID();
public ReturnRandomID()
{
    new rand = random(MAX_PLAYERS);
    while(rand == INVALID_PLAYER_ID)
    {
        rand = random(MAX_PLAYERS);
    }
    return rand;
}
Esse ta milhу...
Reply


Messages In This Thread
[AJUDA] Random player. - by FreeGells - 07.09.2011, 01:26
Re: [AJUDA] Random player. - by Pharrel - 07.09.2011, 01:33
Re: [AJUDA] Random player. - by [H]ead - 07.09.2011, 01:42
Re: [AJUDA] Random player. - by Shelby - 07.09.2011, 01:44
Re: [AJUDA] Random player. - by Pharrel - 07.09.2011, 01:46
Re: [AJUDA] Random player. - by [H]ead - 07.09.2011, 01:46
Re: [AJUDA] Random player. - by [H]ead - 07.09.2011, 01:51
Re: [AJUDA] Random player. - by Pharrel - 07.09.2011, 01:53
Re: [AJUDA] Random player. - by [H]ead - 07.09.2011, 01:55
Re: [AJUDA] Random player. - by FreeGells - 07.09.2011, 01:56

Forum Jump:


Users browsing this thread: 1 Guest(s)