Array indexes
#1

Hello, Im creating a bunch of vehicles and im using array indexes but i don't really understand why thats better?
because its not really easier to make so i was wondering why is it better to use array indexes? ( IF its even better ).


Thanks.
Reply
#2

Persoally I Think AddStaticVehicle Is So Much Easier Because theres So many things that cannot go wrong unless self stupidiness
Reply
#3

Quote:
Originally Posted by Bmxerlmao5288
View Post
Persoally I Think AddStaticVehicle Is So Much Easier Because theres So many things that cannot go wrong unless self stupidiness
Yes its not that i mean.. Like this:

With:
pawn Code:
Vehicle[0] = AddStaticVehicle(..........);
Vehicle[1] = AddStaticVehicle(..........);
Vehicle[2] = AddStaticVehicle(..........);
Vehicle[3] = AddStaticVehicle(..........);
Without:
pawn Code:
Vehicle1 = AddStaticVehicle(..........);
Vehicle2 = AddStaticVehicle(..........);
Vehicle3 = AddStaticVehicle(..........);
Vehicle4 = AddStaticVehicle(..........);
Which one is best and why?
Reply
#4

Array indexes, they are faster and use up less memory. (Someone told me that a while ago, idk if it will be true in your context.)
Reply
#5

Quote:
Originally Posted by linuxthefish
View Post
Array indexes, they are faster and use up less memory. (Someone told me that a while ago, idk if it will be true in your context.)
Okay thanks. But is it possible to switch between array indexes?

Example:
pawn Code:
switch (vehicle[2]) // this won't work for some reason.. only case 2 will be called :/.
{
     case 0:
     {
           //??
     }
     case 1:
     {
          //??
     }
// and so on..
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)