Need help with arrays.
#2

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
hi all i have 1 question, if i have
pawn Код:
new buyablevehicles[][32] = {
    {400, "Landstalker", 15000}
};
how to get 400, then "Landstalker", and then 15000?
1. use enumeration

enum Vehicleinfo ( size 34 - variable structure )
{
Model, //array 0
Name[32], //array 1-32
Price //array 33
}
new buyablevehicles[][Vehicleinfo] =
{
{400, "Landstalker", 15000},
{493, "bmx", 1500}
}

and you can refer it with buyablevehicles[Model], (or buyablevehicles[Vehicleinfo:0] )
buyablevehicles[Name], buyablevehicles[Price]

this is the best way to implement the requested feature ( as far as I know ) Thanks.
Reply


Messages In This Thread
Need help with arrays. - by CoaPsyFactor - 22.08.2010, 03:10
Re: Need help with arrays. - by dax123 - 22.08.2010, 03:34
Re: Need help with arrays. - by CoaPsyFactor - 22.08.2010, 03:52

Forum Jump:


Users browsing this thread: 1 Guest(s)