depato123 Posted March 25, 2014 Share Posted March 25, 2014 Hola. tengo un problema con este script function create( player, vehicle ) if isElement( player ) and isElement( vehicle ) then local characterID = exports.players:getCharacterID( player ) if characterID then local model = getElementModel( vehicle ) local x, y, z = getElementPosition( vehicle ) local rx, ry, rz = getVehicleRotation( vehicle ) local interior = getElementInterior( vehicle ) local dimension = getElementDimension( vehicle ) local color1, color2 = getVehicleColor( vehicle ) local vehicleID, error = exports.sql:query_insertid( "INSERT INTO vehicles (model, posX, posY, posZ, rotX, rotY, rotZ, numberplate, color1, color2, respawnPosX, respawnPosY, respawnPosZ, respawnRotX, respawnRotY, respawnRotZ, interior, dimension, respawnInterior, respawnDimension, characterID) VALUES (" .. table.concat( { model, x, y, z, rx, ry, rz, '"%s"', color1, color2, x, y, z, rx, ry, rz, interior, dimension, interior, dimension, characterID }, ", " ) .. ")", getVehiclePlateText( vehicle ) ) --- Aqui está el problema. if vehicleID then local newVehicle = createVehicle( model, x, y, z, rx, ry, rz, getVehiclePlateText( vehicle ) ) -- tables for ID -> vehicle and vehicle -> data vehicleIDs[ vehicleID ] = newVehicle vehicles[ newVehicle ] = { vehicleID = vehicleID, respawnInterior = interior, respawnDimension = dimension, characterID = characterID, engineState = false, tintedWindows = false, fuel = 100 } -- some properties setVehicleColor( newVehicle, color1, color2, color1, color2 ) -- most vehicles don't use second/third color anyway setVehicleRespawnPosition( newVehicle, x, y, z, rx, ry, rz ) setElementInterior( newVehicle, interior ) setElementDimension( newVehicle, dimension ) setVehicleEngineState( newVehicle, false ) setVehicleOverrideLights( newVehicle, 1 ) setElementData( newVehicle, "fuel", 100 ) return newVehicle, vehicleID end end end end Error: No se porque me dice que el argumento es invalido, si yo ya especifiqué que model es vehicle ¡¡Ayuda!! Link to comment
Castillo Posted March 25, 2014 Share Posted March 25, 2014 Y cual seria la linea 443 en ese pedazo de codigo? Link to comment
MTA Team 0xCiBeR Posted March 25, 2014 MTA Team Share Posted March 25, 2014 Puso: "aqui esta el problema" local vehicleID, error = exports.sql:query_insertid( "INSERT INTO vehicles (model, posX, posY, posZ, rotX, rotY, rotZ, numberplate, color1, color2, respawnPosX, respawnPosY, respawnPosZ, respawnRotX, respawnRotY, respawnRotZ, interior, dimension, respawnInterior, respawnDimension, characterID) VALUES (" .. table.concat( { model, x, y, z, rx, ry, rz, '"%s"', color1, color2, x, y, z, rx, ry, rz, interior, dimension, interior, dimension, characterID }, ", " ) .. ")", getVehiclePlateText( vehicle ) ) --- Aqui está el problema. table.concat (table [, sep [, i [, j]]]) Revisa los valores, creo que no estas especificando la tabla en table.concat Link to comment
Recommended Posts