SA-MP Forums Archive
problem with constant expression with mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: problem with constant expression with mysql (/showthread.php?tid=363506)



problem with constant expression with mysql - Gumica - 27.07.2012

Error I get:
Код:
(150) : error 008: must be a constant expression; assumed zero
Code I have

pawn Код:
public OnPlayerRequestSpawnAtJoin(playerid)
{
    new temp[12];
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
        cache_get_row(0,5,temp); logged = strval(temp);
        cache_get_row(0,4,temp); registration = strval(temp);
        if{logged == 1) // 150th line
        {
            if(registration == 0) {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before registering \n \n Please register","Register","Cancel");
            return 0;
            }
            else {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before logging \n \n Please login","Login","Cancel");
            return 0;
            }
        }
    }
    return 1;
}



Re: problem with constant expression with mysql - SomebodyAndMe - 27.07.2012

You changed the ( to a {
pawn Код:
public OnPlayerRequestSpawnAtJoin(playerid)
{
    new temp[12];
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
        cache_get_row(0,5,temp); logged = strval(temp);
        cache_get_row(0,4,temp); registration = strval(temp);
        if(logged == 1) // 150th line
        {
            if(registration == 0) {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before registering \n \n Please register","Register","Cancel");
            return 0;
            }
            else {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before logging \n \n Please login","Login","Cancel");
            return 0;
            }
        }
    }
    return 1;
}



Re: problem with constant expression with mysql - Gumica - 27.07.2012

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
You changed the ( to a {
pawn Код:
public OnPlayerRequestSpawnAtJoin(playerid)
{
    new temp[12];
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
        cache_get_row(0,5,temp); logged = strval(temp);
        cache_get_row(0,4,temp); registration = strval(temp);
        if(logged == 1) // 150th line
        {
            if(registration == 0) {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before registering \n \n Please register","Register","Cancel");
            return 0;
            }
            else {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "ERROR","You cannot spawn before logging \n \n Please login","Login","Cancel");
            return 0;
            }
        }
    }
    return 1;
}
Ahaha, thank you very much I'm blind seems like :P