Error problem!
#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


Messages In This Thread
Fixed! - by Giroud12 - 23.08.2013, 16:06
Re: Error problem! - by efrim123 - 23.08.2013, 16:07
Re: Error problem! - by Giroud12 - 23.08.2013, 16:09
Re: Error problem! - by Konstantinos - 23.08.2013, 16:10
Re: Error problem! - by Dragonsaurus - 23.08.2013, 16:15
Re: Error problem! - by Giroud12 - 23.08.2013, 16:17
Re: Error problem! - by Dragonsaurus - 23.08.2013, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)