problem when generating number
#1

Why this code restarts server?
pawn Code:
stock GeneratePhoneNumber(playerid)
{


            PVar[playerid][pNumber] = 10000 + random(89999);
            do
            {
                PVar[playerid][pNumber] = 10000 + random(89999);
                new Query[300];
                format(Query, sizeof(Query), "SELECT id FROM `playerinfo` WHERE `Number` = %i LIMIT 1", PVar[playerid][pNumber]);
                mysql_query(Query); //Queries
                mysql_store_result();

            }
            while mysql_num_rows() != 0;
            mysql_free_result();
            return 1;

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)