invalid expression, assumed zero
#1

I recently put my script in notepad to back it up, I managed to do something wrong in the script so I pasted the backup in pawno and ran it. It had deleted every " and / and some other stuff got messed up to..
After fixing tons of errors, I get this: "error 029: invalid expression, assumed zero" It applies to the following code:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 666)
    {
         if(response)
        {
            new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
            INI_WriteInt(File, "Respect",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "RP Points",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
            INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
            INI_WriteInt(File, "Exp", PlayerInfo[playerid][pExp] = 0);
            INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
            INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
            INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
            INI_Close(File);
            SCM(playerid, COLOR_RED, "You have registered. You may now spawn.");
            gPlayerLogged[playerid] = 1;
        }
        else if(dialogid == 667)
    {
        if(response)
        {
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                gPlayerLogged[playerid] = 1;
                GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
            }

    else
            {

                gPlayer[playerid] += 1;
                if(gPlayer[playerid] == 1)
                {
                SCM(playerid, COLOR_RED, "Wrong Password. 1/3");

                }

                if(gPlayer[playerid] == 2)
                {
                SCM(playerid, COLOR_RED, "Wrong Password. 2/3");

                }

                if(gPlayer[playerid] == 3)
                {
                SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                    Kick(playerid);
                }


            }
        }

    }

    return 1;
}
Reply
#2

Try this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 666)
    {
        if(response)
        {
            new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
            INI_WriteInt(File, "Respect",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "RP Points",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
            INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
            INI_WriteInt(File, "Exp", PlayerInfo[playerid][pExp] = 0);
            INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
            INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
            INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
            INI_Close(File);
            SCM(playerid, COLOR_RED, "You have registered. You may now spawn.");
            gPlayerLogged[playerid] = 1;
        }
        else if(dialogid == 667)
        {
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    gPlayerLogged[playerid] = 1;
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
                }
                else
                {

                    gPlayer[playerid] += 1;
                    if(gPlayer[playerid] == 1)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
                    }

                    if(gPlayer[playerid] == 2)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
                    }

                    if(gPlayer[playerid] == 3)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                        Kick(playerid);
                    }
                }
            }
        }

    }
    return 1;
}
Reply
#3

which line contain error show us the line or point the line
Reply
#4

Quote:
Originally Posted by Youwannaplayarough?OKAY!
Посмотреть сообщение
Try this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 666)
    {
        if(response)
        {
            new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
            INI_WriteInt(File, "Respect",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "RP Points",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
            INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
            INI_WriteInt(File, "Exp", PlayerInfo[playerid][pExp] = 0);
            INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
            INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
            INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
            INI_Close(File);
            SCM(playerid, COLOR_RED, "You have registered. You may now spawn.");
            gPlayerLogged[playerid] = 1;
        }
        else if(dialogid == 667)
        {


        {
        if(response)
        {
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                gPlayerLogged[playerid] = 1;
                GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
            }
            else
            {

                gPlayer[playerid] += 1;
                if(gPlayer[playerid] == 1)
                {

                SCM(playerid, COLOR_RED, "Wrong Password. 1/3");

                }
                if(gPlayer[playerid] == 2)
                {

                SCM(playerid, COLOR_RED, "Wrong Password. 2/3");

                }
                if(gPlayer[playerid] == 3)
                {

                SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                    Kick(playerid);
                }


            }
        }

    }

    return 1;
}
I get 6 errors with that. I added a curly bracket onto the end of it and I get:
warning 209: function "OnDialogResponse" should return a value

And thats it.
Reply
#5

I edited a new copy it and paste it again please.
Reply
#6

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 666)
    {
        if(response)
        {
            new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
            INI_WriteInt(File, "Respect",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "RP Points",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
            INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
            INI_WriteInt(File, "Exp", PlayerInfo[playerid][pExp] = 0);
            INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
            INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
            INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
            INI_Close(File);
            SCM(playerid, COLOR_RED, "You have registered. You may now spawn.");
            gPlayerLogged[playerid] = 1;
        }
        else if(dialogid == 667)
        {
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    gPlayerLogged[playerid] = 1;
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
                }
                else
                {

                    gPlayer[playerid] += 1;
                    if(gPlayer[playerid] == 1)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
                    }

                    if(gPlayer[playerid] == 2)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
                    }

                    if(gPlayer[playerid] == 3)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                        Kick(playerid);
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Danyal
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 666)
    {
        if(response)
        {
            new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
            INI_WriteInt(File, "Respect",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "RP Points",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
            INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
            INI_WriteInt(File, "Exp", PlayerInfo[playerid][pExp] = 0);
            INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
            INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
            INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
            INI_Close(File);
            SCM(playerid, COLOR_RED, "You have registered. You may now spawn.");
            gPlayerLogged[playerid] = 1;
        }
        else if(dialogid == 667)
        {
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    gPlayerLogged[playerid] = 1;
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
                }
                else
                {

                    gPlayer[playerid] += 1;
                    if(gPlayer[playerid] == 1)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
                    }

                    if(gPlayer[playerid] == 2)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
                    }

                    if(gPlayer[playerid] == 3)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                        Kick(playerid);
                    }
                }
            }
        }
    }
    return 1;
}
Thank you! Repped
Reply
#8

Now it does not give errors but when I try and login in game it brings up the dialog box and then after I click accept it does nothing..
Reply
#9

Bumpidy Bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)