How Would I Do This?
#1

I want to make ALLOT of pickups so how would i make allot of them with Float?

like:

Код:
Float:Pickups[5][100] =
{...,...,...,...},
{...,...,...,...},
{...,...,...,...},
{...,...,...,...},
{...,...,...,...},
{...,...,...,...},
{...,...,...,...}
something like that, is it possible, and if it is how would i do this?
Reply
#2

Код:
new PickModelType[7][2] = {
{model,type},//1
{model,type},//2
{model,type},
{model,type},
{model,type},
{model,type},
{model,type}//7
};
Код:
new Float:PickupsPos[3][7] = { // 7 numbers of pos
{X,Y,Z},//1 
{X,Y,Z},//2
{X,Y,Z},//3
{X,Y,Z},
{X,Y,Z},
{X,Y,Z},
{X,Y,Z}//7
};
OnGameModeInit:
Код:
for(new i=0; i < 7; i++) {
  AddStaticPickup(PickModelType[i][0], PickModelType[i][1], PickupsPos[i][0],PickupsPos[i][1],PickupsPos[i][2]);
}
Reply
#3

Use this instead, Its easyer
pawn Код:
new Pickups[7][5] =
{
{model,type,X,Y,Z},
{model,type,X,Y,Z},
{model,type,X,Y,Z},
{model,type,X,Y,Z},
{model,type,X,Y,Z},
{model,type,X,Y,Z},
{model,type,X,Y,Z}
};
then
pawn Код:
for(new i=0; i < 7; i++)
{
  AddStaticPickup(Pickups[i][0], Pickups[i][1], Pickups[i][2],Pickups[i][3],Pickups[i][4]);
}
Reply
#4

Nope :P tag mismatch ?
Reply
#5

pawn Код:
enum _pickups
{
  Float:x,
  Float:y,
  Float:z,
  model,
  type,
};

new pickups[][_pickups] =
{
  { x, y, z, model, type },
  { x, y, z, model, type },
  [...]
  { x, y, z, model, type } // no trailing comma on the last one
};

public OnGameModeInit()
{
  for (new i = 0; i < sizeof(pickups); i++)
    AddStaticPickup(pickups[i][model], pickups[i][type], pickups[i][x], pickups[i][y], pickups[i][z]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)