[HELP] Loop for phone
#1

I need help here.. i am trying to give a player random numbers por phone.. but i got an error when i am trying to make the loop

i got this errors

Код:
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(641) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(641) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(641) : error 001: expected token: ")", but found ";"
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(641) : error 036: empty statement
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(641) : fatal error 107: too many error messages on one line
here is the line 641

Код:
Line 641

for(new rphone = 10000 + random(89999); MySQLCheckPhone(rphone) = 0; rphone++)
Please help me if you can
Reply
#2

What are you trying to do with mysql part? Sorry I dint know anything about that. I know that its in the wrong place either way.
Reply
#3

Quote:
Originally Posted by Backwardsman97
What are you trying to do with mysql part? Sorry I dint know anything about that. I know that its in the wrong place either way.
yeah.. well the function i use there is and mysql function if someone player in the database have the number.. the function return a number different than 0.. and if nobody have the number the function return 0
Reply
#4

Very simple:

pawn Код:
stock LookForNum(num)
{
    MySQLCheck();

    new
        query[65];

    format(query, sizeof(query), "SELECT * FROM `table` WHERE Number='%d'", num);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
        mysql_free_result();
        return 1;
    }
    else
    {
        mysql_free_result();
        return 0;
    }
/*
  change:
  table for the table where the numbers are
  Number='s' for the field where the numbers are (just change the word "Number")
*/

}
Usage: LookForNum(number) (LookForNum(1245))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)