Grouping cars
#1

I have 50 cars Car[0], Car[1] and so on till Car[49]

how can I make
pawn Код:
new vehicleid = /* Car[0] - Car[49] without listiing all of them 1 by 1*/
Reply
#2

This?

pawn Код:
new vehicleid[50];

for(new i; i < sizeof Car; i++)
    vehicleid[i]= Car[i];
Reply
#3

Quote:
Originally Posted by HondaCBR
Посмотреть сообщение
I have 50 cars Car[0], Car[1] and so on till Car[49]

how can I make
pawn Код:
new vehicleid = /* Car[0] - Car[49] without listiing all of them 1 by 1*/


At the end vehicleid will be just Car[49], because it's not an array.

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
This?

pawn Код:
new vehicleid[50];

for(new i; i < sizeof Car; i++)
    vehicleid[i]= Car[i];
It will work, but at the end it's useless .-.
And if he does that into a callback event like OnPlayerEnterVehicle(playerid, vehicleid ....) it will give an error, because vehicleid is not defined as an array... ("error 028: invalid subscript (not an array or too many subscripts): "vehicleid"") and other 3 errors more

I think HondaCBR didn't make the right question...
Can you show us all the callback that contains the code you need?
Reply
#4

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
I think HondaCBR didn't make the right question...
I also think
Reply
#5

No man, I made the right question, Viniborn helped me enough, it works. Thx.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)