Error help
#1

Error help heres the code:
pawn Код:
switch(listitem) {
                case 0: {
                    if(playerVariables[playerid][pMaterials] >= 30) {
                        if(playerVariables[playerid][pScrewDriver] == 1) {
                        givePlayerValidWeapon(playerid, 8);
                        playerVariables[playerid][pMaterials] -= 30;
                        SendClientMessage(playerid, COLOR_WHITE, "You have created a katana. Type /giveweapon [playerid] to pass the weapon on.");
                        format(szMessage, sizeof(szMessage), "* %s has created a katana from their materials.", szPlayerName);
                        nearByMessage(playerid, COLOR_PURPLE, szMessage);
                        playerVariables[playerid][pJobDelay] = 30;
                        playerVariables[playerid][pJobSkill][0]++;
                        switch(playerVariables[playerid][pJobSkill][0]) {
                            case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
                                format(szMessage,sizeof(szMessage),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",playerVariables[playerid][pJobSkill][0]/50);
                                SendClientMessage(playerid,COLOR_WHITE,szMessage);
                            }
                        }
The errors:
pawn Код:
Arko.pwn(8231) : error 014: invalid statement; not in switch
Arko.pwn(8231) : warning 215: expression has no effect
Arko.pwn(8231) : error 001: expected token: ";", but found ":"
Arko.pwn(8231) : error 029: invalid expression, assumed zero
Arko.pwn(8231) : fatal error 107: too many error messages on one line
Heres the line that i add that makes the errors appear if(playerVariables[playerid][pScrewDriver] == 1) {

Can someone please help me.
Reply
#2

Try this:
pawn Код:
switch(listitem) {
                case 0: {
                    if(playerVariables[playerid][pMaterials] >= 30) {
                        if(playerVariables[playerid][pVehicleParts] == 1) {
                            givePlayerValidWeapon(playerid, 8);
                            playerVariables[playerid][pMaterials] -= 30;
                            SendClientMessage(playerid, COLOR_WHITE, "You have created a katana. Type /giveweapon [playerid] to pass the weapon on.");
                            format(szMessage, sizeof(szMessage), "* %s has created a katana from their materials.", szPlayerName);
                            nearByMessage(playerid, COLOR_PURPLE, szMessage);
                            playerVariables[playerid][pJobDelay] = 30;
                            playerVariables[playerid][pJobSkill][0]++;
                            switch(playerVariables[playerid][pJobSkill][0]) {
                                case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
                                    format(szMessage,sizeof(szMessage),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",playerVariables[playerid][pJobSkill][0]/50);
                                    SendClientMessage(playerid,COLOR_WHITE,szMessage);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Reply
#3

Quote:
Originally Posted by tsonn1
Посмотреть сообщение
Try this:
pawn Код:
switch(listitem) {
                case 0: {
                    if(playerVariables[playerid][pMaterials] >= 30) {
                        if(playerVariables[playerid][pVehicleParts] == 1) {
                            givePlayerValidWeapon(playerid, 8);
                            playerVariables[playerid][pMaterials] -= 30;
                            SendClientMessage(playerid, COLOR_WHITE, "You have created a katana. Type /giveweapon [playerid] to pass the weapon on.");
                            format(szMessage, sizeof(szMessage), "* %s has created a katana from their materials.", szPlayerName);
                            nearByMessage(playerid, COLOR_PURPLE, szMessage);
                            playerVariables[playerid][pJobDelay] = 30;
                            playerVariables[playerid][pJobSkill][0]++;
                            switch(playerVariables[playerid][pJobSkill][0]) {
                                case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
                                    format(szMessage,sizeof(szMessage),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",playerVariables[playerid][pJobSkill][0]/50);
                                    SendClientMessage(playerid,COLOR_WHITE,szMessage);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Thanks what did you do to make it work?
Reply
#4

I added some "}"s and some " "s.
Reply
#5

Quote:
Originally Posted by tsonn1
Посмотреть сообщение
I added some "}"s and some " "s.
Thanks didnt see it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)