SA-MP Forums Archive
Grouping cars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Grouping cars (/showthread.php?tid=333998)



Grouping cars - HondaCBR - 13.04.2012

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*/



Re: Grouping cars - ViniBorn - 13.04.2012

This?

pawn Код:
new vehicleid[50];

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



Re: Grouping cars - Sasino97 - 13.04.2012

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?


Re: Grouping cars - ViniBorn - 13.04.2012

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


Re: Grouping cars - HondaCBR - 13.04.2012

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