C:\Users\Dedsec\Downloads\Compressed\BWT 0.3ZR4\gamemodes\wt.pwn(321) : error 033: array must be indexed (variable "-unknown-")
switch (classid)
#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;
}
|
Vocк criou uma matriz multidimensional e estб tentando usar como uma simples variбvel inteira.
|
enum jInfo
{
jNome[30],
Float:jSpawn[3],
jCor
};
new jExemplo[][jInfo] = {
{"Nulo", {0.0, 0.0, 0.0}, COR_NULO},
{"Caminhoneiro", {0.0, 0.0, 0.0}, COR_CAMINHAO} // ,
// [...]
};
enum jInfo2
{
MinhaGang // ,
// [....]
};
new InfoPlayer[MAX_PLAYERS][jInfo2];
// Setar ele como uma gang
InfoPlayer[playerid][MinhaGang] = 0; // Nulo
InfoPlayer[playerid][MinhaGang] = 1; // Caminhoneiro.
/* Caso queira que o sistema faзa automбtico utilize um simples
loop retornando o valor da matriz: */
new j;
for( ; j < sizeof(jExemplo); ++j )
// Para setar eles, sem precisar de switch, if's, etc.
SetPlayerPos(playerid, jExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][0], jExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][1], jExemplo[InfoPlayer[playerid][MinhaGang]][jSpawn][2]);
SetPlayerColor(playerid, jExemplo[InfoPlayer[playerid][MinhaGang]][jCor]);
printf("Olб, eu sou da gang: %s", jExemplo[InfoPlayer[playerid][MinhaGang]][jNome]);