Complicated arrays (or at least i think so)
#1

What am i doing wrong
Код:
new Float:CarParkFloor[10][4] = {
{2116.7153,2416.4597,10.8203,0},
{2116.7153,2416.4597,15.1172,0},
{2116.7153,2416.4597,19.4219,0},
{2116.7153,2416.4597,23.7188,0},
{2116.7153,2416.4597,28.0234,0},
{2116.7153,2416.4597,32.3203,0},
{2116.7153,2416.4597,36.6172,0},
{2116.7153,2416.4597,40.9219,0},
{2116.7153,2416.4597,45.2188,0},
{2116.7153,2416.4597,49.5234,0}
};
under init

Код:
  for (new i=0; i<10; i++) {
    AddStaticPickup(1239, 23,
    CarParkFloor[0][0],
    CarParkFloor[0][1],
    CarParkFloor[0][2],
    CarParkFloor[0][3]);
  }
I'm getting a 213 Tag Mismatch
Reply
#2

Virtualworld is 0 by default, so

pawn Код:
new Float:CarParkFloor[10][3] = {
{2116.7153,2416.4597,10.8203},
{2116.7153,2416.4597,15.1172},
{2116.7153,2416.4597,19.4219},
{2116.7153,2416.4597,23.7188},
{2116.7153,2416.4597,28.0234},
{2116.7153,2416.4597,32.3203},
{2116.7153,2416.4597,36.6172},
{2116.7153,2416.4597,40.9219},
{2116.7153,2416.4597,45.2188},
{2116.7153,2416.4597,49.5234}
};
also change the 0 to i here

pawn Код:
for (new i=0; i<10; i++) {
    AddStaticPickup(1239, 23,
    CarParkFloor[i][0],
    CarParkFloor[i][1],
    CarParkFloor[i][2]);
  }
Reply
#3

thanks

the 0 to an i would be what i was going to do but for debugging i was using 0

thanks for the virtual world tip

EDIT:
new code works

Код:
  for (new i=0; i<sizeof(CarParkFloor); i++) {
    AddStaticPickup(1239, 23,
    CarParkFloor[i][0],
    CarParkFloor[i][1],
    CarParkFloor[i][2]);
  }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)