Jump to content

Eroare Shop


praunedo

Recommended Posts

ERORI

C:\Users\Raul\Desktop\praunedo rpg new hit 2020\gamemodes\controlulPraunedo.pwn(10794) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Raul\Desktop\praunedo rpg new hit 2020\gamemodes\controlulPraunedo.pwn(10794) : error 029: invalid expression, assumed zero
C:\Users\Raul\Desktop\praunedo rpg new hit 2020\gamemodes\controlulPraunedo.pwn(10794) : warning 215: expression has no effect
C:\Users\Raul\Desktop\praunedo rpg new hit 2020\gamemodes\controlulPraunedo.pwn(10794) : error 001: expected token: ";", but found "]"
C:\Users\Raul\Desktop\praunedo rpg new hit 2020\gamemodes\controlulPraunedo.pwn(10794) : fatal error 107: too many error messages on one line

 

Linii:

            SelectedItem[playerid] = listitem;    
            ShowPlayerDialog(playerid, DIALOG_SHOP_TREASURE1, DIALOG_STYLE_MSGBOX, "Treasure Shop:", szDialog, "Ok", "Back");

Tot dialogul:

        case DIALOG_SHOP_TREASURE: {
            new szDialog[1100];
            if(!response) { InShop[playerid] = 0; return 1; }
            listitem --;
            switch(listitem) {
            case -1: {
                strcat(szDialog, "Pentru mai multe detalii [/help --> Treasure]");
            }
            case 0: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un cont premium?\nPentru asta, ai nevoie de 800 Treasure Points.\n\n\
                Avantaje:\n-Interes 0.2 la payday\n- 2 RP-uri o data la 5 ore\n- Poti avea 5 masini personale in total\n\
                - numarul (/carplate) o sa fie de culoare portocalie.\n- acces la comanda /pcolor.\n- Poti pune pana la 100 obiecte in casa.");
                SetPVarInt(playerid, "TreasurePoints", 800);                
            }
            case 1: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi 10 FP-uri?\nPentru asta, ai nevoie de 150 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 150);
            }
            case 2: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti schimbi numele?\nPentru asta, ai nevoie de 200 Treasure Points. ");
                SetPVarInt(playerid, "TreasurePoints", 200);                
            }
            case 3: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi un warn?\nPentru asta, ai nevoie de 350 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 350);
            }
            case 4: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un MP3?\nPentru asta, ai nevoie de 120 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 120);
            }
            case 5: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un Rare Voucher?\nPentru asta, ai nevoie de 500 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 500);
            }
            case 6: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un iPhone?\nPentru asta, ai nevoie de 170 Treasure Points.\n\n\
                Avantaje:\n- Numar format din 4 cifre\n- Texte modificate la /call respectiv /sms\n- Acces la comanda /reply (/re).");
                SetPVarInt(playerid, "TreasurePoints", 170);
            }
            SelectedItem[playerid] = listitem;    
            ShowPlayerDialog(playerid, DIALOG_SHOP_TREASURE1, DIALOG_STYLE_MSGBOX, "Treasure Shop:", szDialog, "Ok", "Back");
        }        
        case DIALOG_SHOP_TREASURE1: {
            if(!response) { InShop[playerid] = 0; ShowTreasureShop(playerid); return 1; }
            new treasure = GetPVarInt(playerid, "TreasurePoints");
            if(PlayerInfo[playerid][pTreasurePoints] < treasure) return ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Treasure Shop", "Nu ai suficiente treasure points pentru a achizitiona acest produs.", "Ok", "");
            switch(SelectedItem[playerid]) {
                case 0: {
                    if(PlayerInfo[playerid][pPremiumAccount] == 1) return SendClientMessage(playerid, -1, "Contul tau deja este Premium.");
                      SendClientMessage(playerid, COLOR_GOLD, "Felicitari! Contul tau, este acum, unul de tip Premium.");
                    PlayerInfo[playerid][pPremiumAccount] = 1;
                    Update(playerid, pPremiumAccountx);
                    PlayerInfo[playerid][pTreasurePoints]-=800;
                    format(string, sizeof(string), "%s si-a achizitionat cont premium pentru 150 treasure points.", GetName(playerid));
                    InsertLog(playerid, string, LOG_SHOP);
                }
                case 1: {
                    if(PlayerInfo[playerid][pFpunish] == 0) return SendClientMessage(playerid, COLOR_GREY, "Nu ai faction punish.");
                    PlayerInfo[playerid][pFpunish] -= 10;
                    if(PlayerInfo[playerid][pFpunish] < 0) PlayerInfo[playerid][pFpunish] = 0;
                    UpdateVar(playerid, "FPunish", 0);
                    format(string, sizeof(string), "%s si-a sters FP-ul pentru %d treasurepoints.", GetName(playerid), GetPVarInt(playerid, "TreasurePoints"));
                    InsertLog(playerid, string, LOG_SHOP);    
                    PlayerInfo[playerid][pTreasurePoints]-=150;
                    SCM(playerid,-1,"Ti-ai sters 10 FP pentru 150 de treasure points.");                
                }    
                case 2: {
                    ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Treasure Shop:", "Esti pe cale sa-ti schimbi numele.\nTot ce trebuie sa faci in acest moment, este sa-ti alegi un nume care nu este luat de altcineva.\nLimita este de 3 si 24 caractere.", "Ok", "Back");
                }                            
                case 3: {
                    if(PlayerInfo[playerid][pWarns] == 0) return SendClientMessage(playerid, COLOR_GREY, "Nu ai warn-uri.");
                    PlayerInfo[playerid][pWarns] -= 1;
                    UpdateVar(playerid, "Warnings", PlayerInfo[playerid][pWarns]);
                    PlayerInfo[playerid][pTreasurePoints] -= 350;
                    format(string, sizeof(string), "%s si-a sters un Warn pentru %d treasure points.", GetName(playerid), GetPVarInt(playerid, "TreasurePoints"));
                    InsertLog(playerid, string, LOG_SHOP);                    
                }
                case 4: {
                    if(PlayerInfo[playerid][pMP3] == 1) return SendClientMessage(playerid,COLOR_WHITE, "Ai deja un radio.");
                    PlayerInfo[playerid][pMP3] = 1;
                    SendClientMessage(playerid,COLOR_GOLD,"Felicitari! Ti-ai cumparat un MP3 din magazin. Foloseste /mp3 pentru a asculta muzica.");
                    Update(playerid, pRadiox);
                    PlayerInfo[playerid][pTreasurePoints] -= GetPVarInt(playerid, "TreasurePoints");
                    format(string, sizeof(string), "%s si-a achizitionat un MP3 pentru %d treasure points.", GetName(playerid), GetPVarInt(playerid, "TreasurePoints"));
                    InsertLog(playerid, string, LOG_SHOP);                    
                }
                case 5: {
                    if(PlayerInfo[playerid][pTreasurePoints] < 500) return SCM(playerid, -1, "Nu ai suficiente Treasure Points");
                    PlayerInfo[playerid][pTreasurePoints] -= 500;
                    PlayerInfo[playerid][pVoucher][0] ++;
                    SetPVarInt(playerid, "TreasurePoints", PlayerInfo[playerid][pTreasurePoints]);
                    SCMEx(playerid, COLOR_GREEN, "(SHOP INFO){FFFFFF} Felicitari %s ti-ai cumparat un Rare Voucher pentru suma de 500 Treasure Points!",GetName(playerid));
                    format(string, sizeof(string), "%s si-a achizitionat un Rare Voucher pentru 500 Treasure Points.", GetName(playerid));
                    InsertLog(playerid, string, LOG_SHOP);
                    save_vouchers(playerid);
                }    
                case 6: {
                    ShowPlayerDialog(playerid, DIALOG_IPHONE, DIALOG_STYLE_INPUT, "Treasure Shop:", "Esti pe cale sa-ti achizitionezi un iPhone.\nTot ce trebuie sa faci in acest moment, este sa-ti alegi un numar format din 4 cifre.", "Ok", "Back");
                }
        }                                                    
        case DIALOG_SHOP: {

 

poze:  https://imgur.com/a/bHLMCZy

Link to comment
Share on other sites

Iti lipseste o acolada care inchide switch

case DIALOG_SHOP_TREASURE: {
            new szDialog[1100];
            if(!response) { InShop[playerid] = 0; return 1; }
            listitem --;
            switch(listitem) {
            case -1: {
                strcat(szDialog, "Pentru mai multe detalii [/help --> Treasure]");
            }
            case 0: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un cont premium?\nPentru asta, ai nevoie de 800 Treasure Points.\n\n\
                Avantaje:\n-Interes 0.2 la payday\n- 2 RP-uri o data la 5 ore\n- Poti avea 5 masini personale in total\n\
                - numarul (/carplate) o sa fie de culoare portocalie.\n- acces la comanda /pcolor.\n- Poti pune pana la 100 obiecte in casa.");
                SetPVarInt(playerid, "TreasurePoints", 800);                
            }
            case 1: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi 10 FP-uri?\nPentru asta, ai nevoie de 150 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 150);
            }
            case 2: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti schimbi numele?\nPentru asta, ai nevoie de 200 Treasure Points. ");
                SetPVarInt(playerid, "TreasurePoints", 200);                
            }
            case 3: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi un warn?\nPentru asta, ai nevoie de 350 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 350);
            }
            case 4: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un MP3?\nPentru asta, ai nevoie de 120 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 120);
            }
            case 5: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un Rare Voucher?\nPentru asta, ai nevoie de 500 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 500);
            }
            case 6: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un iPhone?\nPentru asta, ai nevoie de 170 Treasure Points.\n\n\
                Avantaje:\n- Numar format din 4 cifre\n- Texte modificate la /call respectiv /sms\n- Acces la comanda /reply (/re).");
                SetPVarInt(playerid, "TreasurePoints", 170);
            }
            SelectedItem[playerid] = listitem;    
            ShowPlayerDialog(playerid, DIALOG_SHOP_TREASURE1, DIALOG_STYLE_MSGBOX, "Treasure Shop:", szDialog, "Ok", "Back");
        } // Switch tau se termina aici ceea ce e gresit

Varianta corecta e

case DIALOG_SHOP_TREASURE: {
            new szDialog[1100];
            if(!response) { InShop[playerid] = 0; return 1; }
            listitem --;
            switch(listitem) {
            case -1: {
                strcat(szDialog, "Pentru mai multe detalii [/help --> Treasure]");
            }
            case 0: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un cont premium?\nPentru asta, ai nevoie de 800 Treasure Points.\n\n\
                Avantaje:\n-Interes 0.2 la payday\n- 2 RP-uri o data la 5 ore\n- Poti avea 5 masini personale in total\n\
                - numarul (/carplate) o sa fie de culoare portocalie.\n- acces la comanda /pcolor.\n- Poti pune pana la 100 obiecte in casa.");
                SetPVarInt(playerid, "TreasurePoints", 800);                
            }
            case 1: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi 10 FP-uri?\nPentru asta, ai nevoie de 150 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 150);
            }
            case 2: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti schimbi numele?\nPentru asta, ai nevoie de 200 Treasure Points. ");
                SetPVarInt(playerid, "TreasurePoints", 200);                
            }
            case 3: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti stergi un warn?\nPentru asta, ai nevoie de 350 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 350);
            }
            case 4: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un MP3?\nPentru asta, ai nevoie de 120 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 120);
            }
            case 5: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un Rare Voucher?\nPentru asta, ai nevoie de 500 Treasure Points.");
                SetPVarInt(playerid, "TreasurePoints", 500);
            }
            case 6: {
                format(szDialog, sizeof(szDialog), "Esti sigur ca vrei sa-ti achizitionezi un iPhone?\nPentru asta, ai nevoie de 170 Treasure Points.\n\n\
                Avantaje:\n- Numar format din 4 cifre\n- Texte modificate la /call respectiv /sms\n- Acces la comanda /reply (/re).");
                SetPVarInt(playerid, "TreasurePoints", 170);
            }
		}
        SelectedItem[playerid] = listitem;    
        ShowPlayerDialog(playerid, DIALOG_SHOP_TREASURE1, DIALOG_STYLE_MSGBOX, "Treasure Shop:", szDialog, "Ok", "Back");
	} 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.