SA-MP Forums Archive
[Ajuda] error 029: invalid expression, assumed zero - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] error 029: invalid expression, assumed zero (/showthread.php?tid=642882)



error 029: invalid expression, assumed zero - binnyl - 08.10.2017

Eu fiz um sistema de inventario, mas quando fui compilar me daparei com esse erro:
error 029: invalid expression, assumed zero

Alguйm poderia me ajudar?

O erro ta na linha: new InvPlayer[MAX_PLAYERS][MAX_SLOTS][invinfos];

De:
Код:
// INV_1
#define MAX_SLOTS = 20;

enum invinfos
{
    invID,
    invMODEL,
	invTYPE
}
new InvPlayer[MAX_PLAYERS][MAX_SLOTS][invinfos];

new backpack[MAX_PLAYERS];
new slotInvPlayerMexendo[MAX_PLAYERS];
Seria tipo:
InvPlayer[playerid][1][invMODEL] = 30;

Seria uma AK no slot 1 da BP


Re: error 029: invalid expression, assumed zero - RodrigoMSR - 08.10.2017

PHP код:
#define MAX_SLOTS 20 



Re: error 029: invalid expression, assumed zero - binnyl - 08.10.2017

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
PHP код:
#define MAX_SLOTS 20 
Nossa, como eu sou idiota....
Obrigado, +rep

Pq ta dando problema:
error 029: invalid expression, assumed zero

Na funзгo que eu fiz pra falar o nome dos itens?

PHP код:
stock GetItemName(imodelitype) {
    if(
imodel == 58) { // medicamentos
        
if(itype == 1) return "Painkiller";
        else if(
itype == 2) return "Morphine";
        else if(
itype == 3) return "Heat Pack";
        else if(
itype == 4) return "Bandage";
        else if(
itype == 5) return "Medkit";
        else if(
itype == 6) return "Blood Bag";
    }




Re: error 029: invalid expression, assumed zero - RodrigoMSR - 08.10.2017

PHP код:
stock GetItemName(imodelitype) {
    new 
str[20];
    if(
imodel == 58) { // medicamentos
        
if(itype == 1str "Painkiller";
        else if(
itype == 2str "Morphine";
        else if(
itype == 3str "Heat Pack";
        else if(
itype == 4str "Bandage";
        else if(
itype == 5str "Medkit";
        else if(
itype == 6str "Blood Bag";
    }
    return 
str;




Re: error 029: invalid expression, assumed zero - binnyl - 09.10.2017

Obrigado!