Despo_Rutti Posted April 25, 2008 Posted April 25, 2008 (edited) Hi, Sorry for my English (I use Google translation) I am again MTA: DM, after a few tests, I still can not put an "array". In fact, I coded PAWN and I adapt my script LUA. I will show you the table PAWN: enum vInfo { id, Float:pos_x, Float:pos_y, Float:pos_z, Float:pos_za, color1, color2, }; new VehicleInfo[700][infoVeh]; I would like to adapt it to LUA. Thank you in advance for your reply. Edited April 27, 2008 by Guest
Despo_Rutti Posted April 26, 2008 Author Posted April 26, 2008 Sorry for Up but i really need this. Thank's.
Guest Posted April 26, 2008 Posted April 26, 2008 i'm searching Despo, if someone know it pls post here!
Siyo Posted April 26, 2008 Posted April 26, 2008 I guess you could do something like this InfoVeh = { id, pos_x, pos_y, pos_z, pos_za, color1, color2 } VehicleInfo = {} for i=1,700 do -- from VehicleInfo[1] to VehicleInfo[700] VehicleInfo[i] = InfoVeh end And later set the value like this: VehicleInfo[13].id = 12
Despo_Rutti Posted April 26, 2008 Author Posted April 26, 2008 Okay, thank's a lot Siyo ^^. I'll try it now. EDIT: I've got an error, but I don't found it: line 4: VehInfo = {Model, Float:Pos_X, Float:Pos_Y, Float:Pos_Z, Float:Pos_ZA, Couleur1, Couleur2, Proprio, NomVehicule, Vendu} VehicleInfo = {} [01:22:42] SCRIPT ERROR: ...Bureau/Nouveau dossier (2)/mods/deathmatch/resourcecache/broph/broph.lua:4: function arguments expected near ','
50p Posted April 27, 2008 Posted April 27, 2008 You do not have to use "Float:", Lua uses variables and stores in them all types of data, so you don't have to tell script that this is going to be floating point number. Though, you need to tell the script that a var is a table, as you did in line 1 and 2. http://www.lua.org/manual/5.1/
Despo_Rutti Posted April 27, 2008 Author Posted April 27, 2008 Okay, it work. Thank's all. Topic resolved (Sorry very bad English ^^)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now