Problem with random number function
#1

I want to create random number for player when he register and with stock function to make sure that number isn't duplicated for any player. Problem is that it wont work. Does anyone know what i'm missing here?

pawn Код:
do
{
PlayerInfo[playerid][pPin] = 1000 + random(8999);
}
while(PinUsed(playerid));


pawn Код:
stock PinUsed(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
        if(PlayerInfo[playerid][pPin] == PlayerInfo[playerid][pPin] && i != playerid) return 1;
    return 1;
}
Reply


Messages In This Thread
Problem with random number function - by caki - 02.02.2013, 16:08
Re: Problem with random number function - by T0pAz - 02.02.2013, 16:12
Re: Problem with random number function - by caki - 02.02.2013, 16:27
Re: Problem with random number function - by T0pAz - 02.02.2013, 16:30
Re: Problem with random number function - by caki - 02.02.2013, 16:33
Re: Problem with random number function - by T0pAz - 02.02.2013, 16:39
Re: Problem with random number function - by caki - 02.02.2013, 16:46
Re: Problem with random number function - by T0pAz - 02.02.2013, 16:48

Forum Jump:


Users browsing this thread: 1 Guest(s)