Hi, I have yet another problem guys, I don't like troubling you with them but I'm quite involved in a big project now and this is stopping it from compiling completely, and I don't want to revert to my temporary method since this needs to be finished.
Problem - I'm getting an object number illegal at line xxx message. I've had this before and have got around it, but the answer to this seems hard to spot, or I'm just tired, probably the latter.
Here's the code that involves the variable. I've deleted most of the useless parts.
Type Car
Number As Integer
EndType
Global Dim Car(10) As Car
For C = 0 To 10
If File Exist("FilesScriptsCar"+str$(C)+".lua") = 1
R = Load Lua("FilesScriptsCar"+str$(C)+".lua")
Car(C).Number = Lua Get Int("Number")
Next C
For C = 0 To 10
If File Exist("FilesScriptsCar"+str$(C)+".lua") = 1
Load Object "FilesMediaVehiclesCarsCar"+str$(C)+".x",Car(C).Number
Endif
Next C
Do
DriveCar()
Loop
Function DriveCar()
If CanEnterCar = 1
Driving = 1
CurCar.Number = Car(CarAvailable).Number `ERROR HERE!!!
CanEnterCar = 0
Endif
EndFunction
Note - I decrease the CarAvailable variable by 200 in another function to get the variable needed to retrieve the variable from the array.
External Script -
Car1.lua `NOT IN SCRIPT, JUST FILE NAME
Number = 201
Note 1 - Car(C).Number is 201 and that number is not being used for any other objects
Note 2 - I'm not using a float value for it in any case.
Thanks a lot to anyone that can help. If you need anymore information then just ask, as I said before, I need this solved ASAP.