Error problem!
#1

Fixed!
Thanks to KONSTANTINOS
Reply
#2

did you make a filter script?

if yes put in the end of it
#endif
Reply
#3

Lol,its not the solution.
I think the problem is I missing some bracket
Reply
#4

If you could indent your code, you would be able to fix your problems easier. Take a look:
pawn Код:
if (GetPlayerMoney(playerid) <= 5000) return SendClientMessage(playerid, RED, "You don't have enough money!"); //line 314
{
    GivePlayerMoney(playerid,-5000);
    pInfo[playerid][Cookies] += 10;
    new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
    dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
}
if(listitem == 3)
{
    if (GetPlayerMoney(playerid) <= 10000) return SendClientMessage(playerid, RED, "You don't have enough money!");
    {
        GivePlayerMoney(playerid,-10000);
        pInfo[playerid][Cookies] += 20;
        new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
        dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
    }
    if(listitem == 4)
    {
        if (GetPlayerMoney(playerid) <= 25000) return SendClientMessage(playerid, RED, "You don't have enough money!");
        {
            GivePlayerMoney(playerid,-25000);
            pInfo[playerid][Cookies] += 50;
            new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
            dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
        }
       
        return 1;
    }
    return 0;
}
You open braces, and you continue like that without closing and checking the rest. It's like doing nested if statements, when it should be:
pawn Код:
if( something )
{
    // blabla..
}
else if( something )
{
    // blabla..
}
Reply
#5

Dude you are using if statements, returning a message and opening a brace...
Why should you open a brace, you are done with that if clause...
Reply
#6

So how to fix it?
Reply
#7

Where you have if and return in the same line, remove the braces "{" and "}".
Example:
pawn Код:
if (GetPlayerMoney(playerid) <= 5000) return SendClientMessage(playerid, RED, "You don't have enough money!"); //line 314
GivePlayerMoney(playerid,-5000);
pInfo[playerid][Cookies] += 10;
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
You don't need braces here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)