[Ajuda] error 033: array must be indexed (variable "-unknown-")
#1

sou iniciante em pawno, nгo sei se fiz alguma coisa errada.

Код HTML:
C:\Users\Dedsec\Downloads\Compressed\BWT 0.3ZR4\gamemodes\wt.pwn(321) : error 033: array must be indexed (variable "-unknown-")
linha do erro
Код HTML:
switch (classid)





Код HTML:
#define Truckdriver 1

#define MAX_PROFS 2
new classid[MAX_PROFS][30] =
{
{"Nulo"},
{"Caminhoneiro"}
};





no OnDialogResponse


if(dialogid == DialogRescue)
    {
    	if(!response)
    	{
    	switch (classid)
    	{
         case TruckDriver:
    		{
    			switch (listitem)
    			{
    				case 0: SetPlayerPos(playerid,  -525.0, -502.0, 26.0);
    				case 1: SetPlayerPos(playerid,  -74.7, -1137.5, 4.5);
    				case 2: SetPlayerPos(playerid,  1457.0, 975.5, 11.0);
    				case 3: SetPlayerPos(playerid,  -2136.0, -247.5, 36.5);
    				case 4: SetPlayerPos(playerid,  1766.5, -2040.7, 14.0);
    				case 5: SetPlayerPos(playerid,  -546.0, 2594.0, 54.0);
    			}
    		}
    		}
    		}
    		}
    		}
    		return 1;
    		}
Reply
#2

Vocк criou uma matriz multidimensional e estб tentando usar como uma simples variбvel inteira.
Reply
#3

Quote:
Originally Posted by JonathanFeitosa
Посмотреть сообщение
Vocк criou uma matriz multidimensional e estб tentando usar como uma simples variбvel inteira.
cara me ajuda ae
Reply
#4

PHP код:
enum jInfo
{
    
jNome[30],
    
Float:jSpawn[3],
    
jCor
};
new 
jExemplo[][jInfo] = {
    {
"Nulo", {0.00.00.0}, COR_NULO},
    {
"Caminhoneiro", {0.00.00.0}, COR_CAMINHAO// ,
        // [...]
};
enum jInfo2
{
   
MinhaGang // ,
  // [....]
};
new 
InfoPlayer[MAX_PLAYERS][jInfo2]; 
PHP код:
// Setar ele como uma gang
InfoPlayer[playerid][MinhaGang] = 0// Nulo
InfoPlayer[playerid][MinhaGang] = 1// Caminhoneiro. 
PHP код:
/* Caso queira que o sistema faзa automбtico utilize um simples
loop retornando o valor da matriz: */
new j;
for( ; 
sizeof(jExemplo); ++
PHP код:
// Para setar eles, sem precisar de switch, if's, etc.
SetPlayerPos(playeridjExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][0], jExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][1], jExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][2]);
SetPlayerColor(playeridjExemplo[InfoPlayer[playerid][MinhaGang]][jCor]);
printf("Olб, eu sou da gang: %s"jExemplo[InfoPlayer[playerid][MinhaGang]][jNome]); 
Entгo, isso й apenas uma base para vocк. Veja, nгo precisa daquelas leseiras. Й bem mais fбcil trabalhar assim!
Se alguйm criar uma tutorial mais ou menos assim, jб й uma sugestгo.

Enfim, se ocorreu algum erro ou algo do tipo no cуdigo, eu nгo sei pois eu nem cheguei a por no pawno, fiz por aqui mesmo. Espero que consiga tirar uma base ^^
Reply
#5

cara desculpe nгo expliquei tudo mals ae . acontece o seguinte.

#define Truckdriver 1 foi a classe que eu defini ou seja uma classe de caminhoneiro.

issso aqui foi o que eu vi em um site

#define MAX_PROFS 2
new classid[2]=
{
{"Nulo"},
{"Caminhoneiro"}
};

---------------------------------------------------------------------------------------------------------------

eu quero que quando o player escolher uma classe ele va para um dialog de seleзгo de resgate.

tipo ai eu coloquei assim:

public OnPlayerRequestSpawn(playerid)
{
switch classid)
{
case TruckDriver:
{
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Resgate Caminhoneiro:", "Flint Trucking Depot\r\nLVA Freight Depot\r\nDoherty Depot\r\nQuarry Top", "Spawn", "Cancel");
]
}
return1;
}



ai deu erro ai fui definir o DialogRescue acabei apagando coisas e colocando coisas onde nгo devia. ai virou isso ae em cima.

RESUMINDO


eu quero que depois do player escolher a classe, abra um dialog para ele escolher um resgate.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)