error 029: invalid expression, assumed zero
#1

Код:
error 029: invalid expression, assumed zero
pawn Код:
}
        }
    }
    new newstring[128];
    format(newstring, sizeof(newstring), "Welcome Back {43C0F9}%s{FFFFFF}. Please Login (/"#LoginCommand")", PlayerName);
    else SendClientMessage(playerid, WHITE, newstring); //THIS LINE
    }
    return 1;
}
Reply
#2

Well, the indentation is a bit bad and I'm not sure if:

- it's an extra bracket, after else.
- WHITE is defined incorrect.
- LoginCommand is defined incorrect.

Be sure, all of them are correct.
Reply
#3

whats your means of (/"#LoginCommand") ?
Reply
#4

Use it
}else return SendClientMessage(playerid, WHITE,newstring);
Reply
#5

Your mistake is the "else". You do not have an if statement above.
Reply
#6

Yes I know my mistake is else
But I need that else there -_-
Reply
#7

Quote:
Originally Posted by RandomDude
Посмотреть сообщение
Yes I know my mistake is else
But I need that else there -_-
May I ask, why do you need it there when it's incorrect?
Reply
#8

I need it because if the player is registerd and not logged in it will send the player that message but if I don't add else it will send the player the message if logged in or not...
Reply
#9

That's not how it should be.
pawn Код:
if(something)
{
    // blabla
}
else
{
    // blabla
}
Having only the "else" statement without the "if" above is not correct. Use it correctly (the brackets) or just check if the player is registered and not logged in, in an if statement instead of the else.
Reply
#10

This work
pawn Код:
else
        {
            if(AccInfo[playerid][pVip] > 0)
            {
                switch(AccInfo[playerid][pVip])
                {
                    case 1: AccType = "Silver";
                    case 2: AccType = "Gold";
                    case 3: AccType = "Premium";
                }
                format(string,sizeof(string),"|- You have been Automatically Logged in - Account Type: %s", AccType);
                SendClientMessage(playerid,0x00C896AA,string);
            }
            else
            {
                format(string,sizeof(string),"{FFFFFF}Logged in.");
                SendClientMessage(playerid,WHITE,string);
            }
        }
    }
    new newstring[128];
    format(newstring, sizeof(newstring),"Please Login (/"#LoginCommand")");
    SendClientMessage(playerid, WHITE, newstring);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)