error assumed zero
#1

Hi all,

I got another prob, with register dialog.
I dont know why but its giving me this error:
Quote:

(257) : error 029: invalid expression, assumed zero
(260) : error 029: invalid expression, assumed zero
(260) : error 029: invalid expression, assumed zero
(260) : warning 215: expression has no effect
(260) : error 001: expected token: ";", but found "return"
(260) : fatal error 107: too many error messages on one line

on this dialog:
pawn Код:
// This line here <> is line number 256
    if(dialogid == 100){ //Dialog REgister
        if(playerid, response, inputtext[]){
            //The player has pressed "Register"
            new password[23];//Creating a variable to store the password
            if(sscanf(inputtext[]),"s[23]",password)) return KickPlayer(Kick(playerid);
            new file[64],PlayerName[24];
            GetPlayerName(playerid,PlayerName,sizeof PlayerName);
            format(file,sizeof file,"Players/%s.ini",PlayerName);
            if(fexist(file)) return SendClientMessage(playerid,-4,"This username is allready registerd, try another one!");
            INI_Open(file);
            INI_WriteString("Password",password);
            INI_WriteInt("Level",PInfo[playerid][Level]);
            INI_Save();
            INI_Close();
            SendClientMessage(playerid,-1,"You have successfully registered!");
            PInfo[playerid][Logged] = 1;
            return 1;
        }
Can someone help me plz?
I allready changed the ''params'' to ''inputtext'' because a dailog cant have ''params'', maybe I did something wrong there?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
pawn Код:
if(playerid, response, inputtext[])
I'm just wondering what you think this line does?
Checking if the player response smthing..?
Reply
#3

This one?

PHP код:
if (dialogid == 100)
    {
        if(!
response) return Kick(playerid);
                    new 
password[23];//Creating a variable to store the password
            
if(sscanf(inputtext[]),"s[23]",password)) return KickPlayer(Kick(playerid);
            new 
file[64],PlayerName[24];
            
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
            
format(file,sizeof file,"Players/%s.ini",PlayerName);
            if(
fexist(file)) return SendClientMessage(playerid,-4,"This username is allready registerd, try another one!");
            
INI_Open(file);
            
INI_WriteString("Password",password);
            
INI_WriteInt("Level",PInfo[playerid][Level]);
            
INI_Save();
            
INI_Close();
            
SendClientMessage(playerid,-1,"You have successfully registered!");
            
PInfo[playerid][Logged] = 1;
            return 
1;
        } 
Reply
#4

Quote:
Originally Posted by Squirrel
Посмотреть сообщение
This one?

PHP код:
if (dialogid == 100)
    {
        if(!
response) return Kick(playerid);
                    new 
password[23];//Creating a variable to store the password
            
if(sscanf(inputtext[]),"s[23]",password)) return KickPlayer(Kick(playerid);
            new 
file[64],PlayerName[24];
            
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
            
format(file,sizeof file,"Players/%s.ini",PlayerName);
            if(
fexist(file)) return SendClientMessage(playerid,-4,"This username is allready registerd, try another one!");
            
INI_Open(file);
            
INI_WriteString("Password",password);
            
INI_WriteInt("Level",PInfo[playerid][Level]);
            
INI_Save();
            
INI_Close();
            
SendClientMessage(playerid,-1,"You have successfully registered!");
            
PInfo[playerid][Logged] = 1;
            return 
1;
        } 
Still got this errors:

Quote:

C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(259) : warning 217: loose indentation
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : warning 217: loose indentation
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : error 029: invalid expression, assumed zero
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : error 029: invalid expression, assumed zero
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : warning 215: expression has no effect
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : error 001: expected token: ";", but found "return"
C:\Users\Games\Desktop\Server-by Jer\samp03e_svr_R2_win32\gamemodes\World_European_ Trucking.pwn(260) : fatal error 107: too many error messages on one line

Reply
#5

Is this even under OnDialogResponse?

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 100)
    {
        if(!response) return Kick(playerid);
        new password[23];//Creating a variable to store the password
        if(sscanf(inputtext,"s[23]",password)) return Kick(playerid);
        new file[64],PlayerName[24];
        GetPlayerName(playerid,PlayerName,sizeof PlayerName);
        format(file,sizeof file,"Players/%s.ini",PlayerName);
        if(fexist(file)) return SendClientMessage(playerid,-4,"This username is allready registerd, try another one!");
        INI_Open(file);
        INI_WriteString("Password",password);
        INI_WriteInt("Level",PInfo[playerid][Level]);
        INI_Save();
        INI_Close();
        SendClientMessage(playerid,-1,"You have successfully registered!");
        PInfo[playerid][Logged] = 1;
        return 1;
    }
    return 0;  
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)