Enum loads things twice? - 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: Enum loads things twice? (
/showthread.php?tid=629194)
Enum loads things twice? -
danielpalade - 21.02.2017
-- DELETED --
Re: Enum loads things twice? -
PrO.GameR - 21.02.2017
Well DUH, you are loading everything twice, once into a dummy array while not actually loading it to a dummy array, you directly use the main array.
Solution?
create a local array for example:
PHP код:
for(...)
new LocalLoader[vData];
...
now change all those vehicleVariables[i] to LocalLoader
or just load whatever is needed to create the vehicle in the line below, then load directly into your main array.
PHP код:
new y = CreateVehicle(vehicleVariables[i][vehicleModel], vehicleVariables[i][vehiclePos][0], vehicleVariables[i][vehiclePos][1], vehicleVariables[i][vehiclePos][2], vehicleVariables[i][vehiclePos][3], vehicleVariables[i][vehicleColour][0], vehicleVariables[i][vehicleColour][1], -1);