problem with constant expression with mysql
#1

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;
}
Reply
#2

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;
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)