error DialogId
#1

hi I receive this error why?? :

Код:
error 021: symbol already defined: "query"
my code

PHP код:
        case DIALOG_REGISTER_PASS :
        {
            if (
strlen(inputtext) < || strlen(inputtext) > 24 || !response)
            {
                
SendClientMessage(playeridCOLOR_ERROR"Votre mot de pass doit contenir entre 4 et 24 caractйres");
                return 
Kick(playerid);
            }
            new 
query[128],escaped[2][24];
            
mysql_real_escape_string(PlayerName(playerid), escaped[0]);
            
mysql_real_escape_string(inputtextescaped[1]);
            
format(querysizeof(query), "INSERT INTO PlayerData(Name, Password) VALUES('%s', '%s')"escaped[0], escaped[1]);
            
mysql_query(query);
            return 
ShowPlayerDialog(playeridDIALOG_REGISTER_SEXEDIALOG_STYLE_LIST"Votre Sexe""Homme\nFemme""Accepter","");
        }
        
        case 
DIALOG_REGISTER_SEXE :
        {
            new 
query[128];
            if(
listitem == 0)
            {
                
format(querysizeof(query), "UPDATE PlayerData SET Sexe = 'Homme' WHERE Name = '%s'",PlayerName(playerid));
                
mysql_query(query);
            }
            else
            {
                
format(querysizeof(query), "UPDATE PlayerData SET Sexe = 'Femme' WHERE Name = '%s'",PlayerName(playerid));
                
mysql_query(query);
            }
            return 
ShowPlayerDialog(playeridDIALOG_REGISTER_SEXEDIALOG_STYLE_LIST"Votre Sexe""Homme\nFemme""Accepter","");
        } 
Reply
#2

You have new query[128] somewhere outside your switch statement. I can't tell you exactly where as you would need to show more of your script.
Reply
#3

Well if thats the case change it to this.

pawn Код:
new query2[128];
And change all the "query" in your switch statement to "query2". But if you don't want to do that, your going to have to do what Psymetrix said. But it would be more logical to go Psymetrix's route.
Reply
#4

but when I put only this code no error :

PHP код:
    case DIALOG_REGISTER_PASS :
        {
            if (
strlen(inputtext) < || strlen(inputtext) > 24 || !response)
            {
                
SendClientMessage(playeridCOLOR_ERROR"Votre mot de pass doit contenir entre 4 et 24 caractйres");
                return 
Kick(playerid);
            }
            new 
query[128],escaped[2][24];
            
mysql_real_escape_string(PlayerName(playerid), escaped[0]);
            
mysql_real_escape_string(inputtextescaped[1]);
            
format(querysizeof(query), "INSERT INTO PlayerData(Name, Password) VALUES('%s', '%s')"escaped[0], escaped[1]);
            
mysql_query(query);
        } 
Reply
#5

when i test the code step by step :

when I add : escaped[2][25] : I receive the error why??
Reply
#6

This is a bug I had exactly the same error a few days ago, add only here
if(response) {
new query[128];
switch(listitem)
{
Reply
#7

Quote:
Originally Posted by jaskiller
Посмотреть сообщение
when i test the code step by step :

when I add : escaped[2][25] : I receive the error why??
Well what is the error? We can't magically know the error.
Reply
#8

error 021: symbol already defined: "query";

read the other message of post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)