SA-MP Forums Archive
How Would I Do This? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How Would I Do This? (/showthread.php?tid=68083)



How Would I Do This? - StrickenKid - 07.03.2009

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?


Re: How Would I Do This? - Jefff - 07.03.2009

Код:
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]);
}



Re: How Would I Do This? - ICECOLDKILLAK8 - 07.03.2009

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]);
}



Re: How Would I Do This? - Jefff - 07.03.2009

Nope :P tag mismatch ?


Re: How Would I Do This? - [RP]Rav - 07.03.2009

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]);
}