Little help here?
#1

Hello everyone, so I've been making a inventory system and i got these errors recently:

Код:
(1119) : error 002: only a single statement (or expression) can follow each "case"
(1119) : error 029: invalid expression, assumed zero
(1119) : warning 215: expression has no effect
(1119) : error 017: undefined symbol "i"
(1119) : fatal error 107: too many error messages on one line
and here are the code lines:

pawn Код:
if(dialogid == DIALOG_INV) {
        if(response) {
            new msg[100], Float:X,Float:Y,Float:Z;
            switch(listitem) {
                    for(new i=0; i<sizeof(listitem); i++) { // <--------- THE LINE
               
                    case i: {
                        if(PlayerInv[i][playerid] == 0) return SendClientMessage(playerid,CLR_GREY,"This slot is empty.");
                        else if(PlayerInv[i][playerid] == 1) {
                            GivePlayerWeapon(playerid,4,1);
                            PlayerInv[i][playerid] = 0;
                        }
                    }
                }
            }
        }
    }
Thanks in any advice!

P.S. yes, I created that code by myself and i know that it could be a wrong way of scripting that function, but I improvised. So, I would like to know how to make this done?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)