Array adjustments.
#1

Hello everybody.
I need some help. Is it possible to do like this
Код:
new const BuyableCars[][5] = {
{ integer, float, float, float, float },
{ integer, float, float, float, float }
};
Because if you not write Float: before BuyableCars, i get errors, but if you do - another errors.

Thanks for help.
Reply
#2

pawn Код:
enum info
{
 Integer,
 Float:X,
 etc...
}

new BuyableCars[2][info] = {
{ integer, float, float, float, float },
{ integer, float, float, float, float }
};
Reply
#3

I found another way:
Код:
new const Float:BuyableCars[][5] = {
{ integer as float ( ex: 411.0 ), float, float, float, float },
{ integer as float ( ex: 411.0 ), float, float, float, float }
};
And then you gotta to create cars, you do like this:
Код:
CreateVehicle(floatround(BuyableCars[0][0]),BuyableCars[0][1],BuyableCars[0][2],BuyableCars[0][3],BuyableCars[0][4],-1,-1,-1);
But thanks for help anyway. Appreciate.
Reply
#4

But you wont insert string as float
Reply
#5

Quote:
Originally Posted by BuLLeT[LTU]
Посмотреть сообщение
But you wont insert string as float
Problem is, i didn't need a string, i just needed integer between floats.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)