Need help.
#1

Im trying to make a way to input the vehicle model id into this enum and in return get the Type and Weight.
Anyone know how to do that?

Heres the enum:
pawn Код:
enum MissionVehicles
{
    Model,
    Type,
    Weight
}
new mVehicle[][MissionVehicles] =
{
    {403,1,2},
    {433,1,1},
    {455,1,1},
    {456,1,1},
    {498,1,1},
    {514,1,2},
    {515,1,2},
    {578,1,1},
    {609,1,1},
    {573,1,1},
    {511,2,1},
    {512,2,1},
    {513,2,1},
    {519,2,1},
    {553,2,2},
    {577,2,3},
    {592,2,3},
    {417,3,2},
    {469,3,1},
    {548,3,2},
    {563,3,2},
    {487,3,1},
    {488,3,1},
    {413,4,1},
    {414,4,2},
    {440,4,1},
    {459,4,1},
    {478,4,1},
    {482,4,1},
    {483,4,1},
    {495,4,1},
    {499,4,2},
    {543,4,1},
    {552,4,1},
    {554,4,1},
    {582,4,1},
    {605,4,1},
    {438,5,1},
    {420,5,1},
    {431,6,2},
    {437,6,2},
    {524,7,1}
};
Reply
#2

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
In your case you need to loop the array, the model ID's are unsorted, so it's kind of a situation where you need to do much to get almost nothing.

you could however do something like this:

pawn Код:
enum MissionVehicles
{
    Type,
    Weight
}

new ModelInfo[212/*amount of models in GTA*/][MissionVehicles]
{
    {0,4},//for model 400
    {0,5},//for model 401
    //...repeat for all models up to 612
};

stock GetWeight(vehiclemodelid)
{
    return ModelInfo[vehiclemodelid-400][Weight];
}
But then i would have vehicles in the enum that are useless to me.
Reply
#3

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
if you choose smaller array size over consistency you are going to have a bad time. just use {0,0} for vehicles you don't need or {-1,-1} or whatever value combination you want.
I made the new enum with all the vehicles. Thanks for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)