Whats wrong?
#8

Quote:
Originally Posted by iMonk3y
Посмотреть сообщение
Oh I just found out that they're actually called braces Check all your braces!

Код:
An opening brace
{

    Your codes

}
Closing brace
That's how it goes. I think there's somewhere unmatched & extra braces in your script.

Also, don't forget to change under listitem 16, if -statement, there should be 500 instead of 50

Edit: Under listitem 9, 11, 14, 15 and 16 is missing/one extra brace!
It cant missing brackets bcz when i fill the brackets in. Pawn crashes.
And i tried deleting other brackets. And that dosent work either.

EDIT: This is the new code

pawn Код:
if(dialogid == 3) //247
    {
        if(response)
        {
            new string[128];
            if(listitem == 0) //cellphone
            {
                if(!(PlayerInfo[playerid][pPnumber] == 0))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   You already have a cell phone !");
                    return 1;
                }
                if(PlayerInfo[playerid][pCash] > 499)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-500;
                    GivePlayerMoney(playerid,-500);
                    new randphone = 1000 + random(8999);//minimum 1000  max 9999
                    PlayerInfo[playerid][pPnumber] = randphone;
                    format(string, sizeof(string), "~r~-$%d", 500);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    format(string, sizeof(string), "Mobile phone purchased, your new phone number is %d.", randphone);
                    SendClientMessage(playerid, COLOR_GRAD4, string);
                    SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by typing /stats.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now type /help to see your cell phone commands.");
                    GiveBizMoney(playerid, 500);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 1) //phonebook
            {
                if(PlayerInfo[playerid][pCash] > 4999)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-5000;
                    GivePlayerMoney(playerid,-5000);
                    PlayerInfo[playerid][pPhoneBook] = 1;
                    format(string, sizeof(string), "~r~-$%d", 5000);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "Phonebook purchased, you can now look up other players numbers.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /number <id/name>.");
                    GiveBizMoney(playerid, 5000);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 2) //dice
            {
                if(PlayerInfo[playerid][pCash] > 499)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-500;
                    GivePlayerMoney(playerid,-500);
                    PlayerInfo[playerid][pDice] = 1;
                    format(string, sizeof(string), "~r~-$%d", 500);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "Dice purchased.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /dice to use.");
                    GiveBizMoney(playerid, 500);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 3)
            {
                if(PlayerInfo[playerid][pCash] > 4999)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-5000;
                    GivePlayerMoney(playerid,-5000);
                    gVehicleLock[playerid] = 1;
                    format(string, sizeof(string), "~r~-$%d", 5000);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "Lock purchased.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /lock while in a vehicle to use.");
                    GiveBizMoney(playerid, 5000);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 4)
            {
                if(PlayerInfo[playerid][pCash] > 4999)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-5000;
                    GivePlayerMoney(playerid,-5000);
                    gSpeedo[playerid] = 1;
                    format(string, sizeof(string), "~r~-$%d", 5000);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "Speedometer purchased.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /speedo to use.");
                    GiveBizMoney(playerid, 5000);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 5)
            {
                if(PlayerInfo[playerid][pCash] > 49)
                {
                    if(Condom[playerid] <= 6)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-50;
                        GivePlayerMoney(playerid,-50);
                        Condom[playerid] ++;
                        format(string, sizeof(string), "~r~-$%d", 50);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "Condom purchased.");
                        GiveBizMoney(playerid, 50);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 6)
            {
                if(PlayerInfo[playerid][pCash] > 2499)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-2500;
                    GivePlayerMoney(playerid, - 2500);
                    PlayerInfo[playerid][pCDPlayer] = 1;
                    format(string, sizeof(string), "~r~-$%d", 2500);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "CD-Player purchased.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /music to use.");
                    GiveBizMoney(playerid, 2500);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 7)
            {
                if(PlayerInfo[playerid][pCash] > 2499)
                {
                    if(PlayerInfo[playerid][pSpraycan] <= 10)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-200;
                        GivePlayerMoney(playerid, -200);
                        PlayerInfo[playerid][pSpraycan] += 10;
                        format(string, sizeof(string), "~r~-$%d", 200);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "10 Spraycans purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /colorcar or /paintcar while inside a vehicle.");
                        GiveBizMoney(playerid, 2500);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 8)
            {
                if(PlayerInfo[playerid][pCash] > 999)
                {
                    if(PlayerInfo[playerid][pRope] <= 3)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-1000;
                        GivePlayerMoney(playerid, -1000);
                        PlayerInfo[playerid][pRope] += 3;
                        format(string, sizeof(string), "~r~-$%d", 1000);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "3 Ropes purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /tie while driving a car to tie someone.");
                        GiveBizMoney(playerid, 1000);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 9)
            {
                if(PlayerInfo[playerid][pCash] > 99)
                {
                    if(PlayerInfo[playerid][pCigars] <= 10)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-100;
                        GivePlayerMoney(playerid, -100);
                        PlayerInfo[playerid][pCigars] += 10;
                        format(string, sizeof(string), "~r~-$%d", 100);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "10 Cigars purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /usecigar to use your cigars, once used press left mouse button to smoke, F to throw away.");
                        GiveBizMoney(playerid, 100);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
   if(listitem == 10)
            {
                if(PlayerInfo[playerid][pCash] > 9)
                {
                    if(PlayerInfo[playerid][pSprunk] <= 3)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-10;
                        GivePlayerMoney(playerid, -25);
                        PlayerInfo[playerid][pSprunk] += 1;
                        format(string, sizeof(string), "~r~-$%d", 10);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "Sprunk purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /usesprunk to use your sprunk, once used press left mouse button to drink, F to throw away.");
                        GiveBizMoney(playerid, 10);
                        if(PointInfo[9][PointTaken] != 255) //sprunk factory
                        {
                            FamilyInfo[PointInfo[9][PointTaken]][FamilyBank] += 25;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
   if(listitem == 11)
            {
                if(PlayerInfo[playerid][pCash] > 199)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-200;
                    GivePlayerMoney(playerid, -200);
                    PlayerInfo[playerid][pWT] = 1;
                    format(string, sizeof(string), "~r~-$%d", 200);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GRAD4, "Walkie Talkie purchased.");
                    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /WT to talk in your walkie talkie, type /channel to adjust the channel number.");
                    GiveBizMoney(playerid, 200);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 12)
            {
                if(PlayerInfo[playerid][pCash] > 49)
                {
                    if(PlayerInfo[playerid][pScrew] <= 5)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-50;
                        GivePlayerMoney(playerid, -50);
                        PlayerInfo[playerid][pScrew] += 5;
                        format(string, sizeof(string), "~r~-$%d", 50);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "5 Screw Drivers purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /breakin to pick the locks on peoples houses.");
                        GiveBizMoney(playerid, 50);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 13)
            {
                if(PlayerInfo[playerid][pCash] >= 2500)
                {
                    if(PlayerInfo[playerid][pBlindfolds] <= 2)
                    {
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-2500;
                        GivePlayerMoney(playerid, -2500);
                        PlayerInfo[playerid][pBlindfolds] += 2;
                        format(string, sizeof(string), "~r~-$%d", 2500);
                        GameTextForPlayer(playerid, string, 5000, 1);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD4, "2 Blindfolds purchased.");
                        SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /blindfold to blindfold a tied player.");
                        GiveBizMoney(playerid, 2500);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't hold anymore of those !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }

            if(listitem == 14)
            {
                if(GetPlayerMoney(playerid) >= 5000)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-5000;
                    GivePlayerMoney(playerid,-10000);
                    GivePlayerGun(playerid, 43);
                    GameTextForPlayer(playerid,"~r~-$10000", 5000, 1);
                    SendClientMessage(playerid, COLOR_WHITE," You purchased a camera");
                    GiveBizMoney(playerid, 5000);
                    return 1;
                }
            }
   if(listitem == 15)
            {
                if(PlayerInfo[playerid][pCash] > 499)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-500;
                    GiveBizMoney(playerid, 500);
                    HasBoughtMask[playerid] = 1;
                    GameTextForPlayer(playerid,"~w~You purchased a mask for ~r~ $500", 5000, 1);
                    SendClientMessage(playerid, COLOR_WHITE, "Use /mask to take on/off your mask");
                    return 1;
                }
            }
   if(listitem == 16)
            {
                if(PlayerInfo[playerid][pCash] > 49)
                {
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-50;
                    GiveBizMoney(playerid, 500);
                    gotbandage[playerid] = 1;
                    GameTextForPlayer(playerid,"~w~You purchased bandage for ~r~ $50", 5000, 1);
                    SendClientMessage(playerid, COLOR_WHITE, "Use /bandage to use it");
                                   }
                                 }
                             }
                         }
Reply


Messages In This Thread
Whats wrong? - by BizzyD - 30.01.2011, 01:09
Re: Whats wrong? - by iMonk3y - 30.01.2011, 01:18
Re: Whats wrong? - by BizzyD - 30.01.2011, 01:22
Re: Whats wrong? - by BizzyD - 30.01.2011, 01:25
Re: Whats wrong? - by iMonk3y - 30.01.2011, 01:31
Re: Whats wrong? - by BizzyD - 30.01.2011, 01:32
Re: Whats wrong? - by iMonk3y - 30.01.2011, 01:40
Re: Whats wrong? - by BizzyD - 30.01.2011, 02:06
Re: Whats wrong? - by iMonk3y - 30.01.2011, 02:15
Re: Whats wrong? - by BizzyD - 30.01.2011, 13:01

Forum Jump:


Users browsing this thread: 2 Guest(s)