Hallo liebe Community.
Ich habe folgendes Problem.
Lua
function apark_func ( player, command )
if getPedOccupiedVehicleSeat ( player ) == 0 then
local veh = getPedOccupiedVehicle ( player )
if vioGetElementData(source,"adminlvl") >= 2 then
if isTrailerInParkingZone ( veh ) then
local x, y, z = getElementPosition ( veh )
local rx, ry, rz = getVehicleRotation ( veh )
local c1, c2, c3, c4 = getVehicleColor ( veh )
vioSetElementData ( veh, "spawnposx", x )
vioSetElementData ( veh, "spawnposy", y )
vioSetElementData ( veh, "spawnposz", z )
vioSetElementData ( veh, "spawnrotx", rx )
vioSetElementData ( veh, "spawnroty", ry )
vioSetElementData ( veh, "spawnrotz", rz )
vioSetElementData ( veh, "color1", c1 )
vioSetElementData ( veh, "color2", c2 )
vioSetElementData ( veh, "color3", c3 )
vioSetElementData ( veh, "color4", c4 )
outputChatBox ( "Fahrzeug geparkt!", player, 0, 255, 0 )
local Spawnpos_X, Spawnpos_Y, Spawnpos_Z = getElementPosition ( veh )
local Spawnrot_X, Spawnrot_Y, Spawnrot_Z = getVehicleRotation ( veh )
local Farbe1, Farbe2, Farbe3, Farbe4 = getVehicleColor ( veh )
local color = "|"..Farbe1.."|"..Farbe2.."|"..Farbe3.."|"..Farbe4.."|"
local Paintjob = getVehiclePaintjob ( veh )
local Benzin = vioGetElementData ( veh, "fuelstate" )
local pname = vioGetElementData ( veh, "owner" )
local Distance = vioGetElementData ( veh, "distance" )
local slot = vioGetElementData ( veh, "carslotnr_owner" )
MySQL_SetString("vehicles", "Spawnpos_X", Spawnpos_X, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Spawnpos_Y", Spawnpos_Y, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Spawnpos_Z", Spawnpos_Z, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Spawnrot_X", Spawnrot_X, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Spawnrot_Y", Spawnrot_Y, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Spawnrot_Z", Spawnrot_Z, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Farbe", color, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Paintjob", Paintjob, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Benzin", Benzin, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
MySQL_SetString("vehicles", "Distance", Distance, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
else
outputChatBox ( "Dieses Fahrzeug kannst du nicht in der Stadt parken!", player, 125, 0, 0 )
end
else
outputChatBox ( "Dieses Fahrzeug gehoert dir nicht!", player, 255, 0, 0 )
end
else
outputChatBox ( "Du musst in einem Fahrzeug sitzen!", player, 255, 0, 0 )
end
end
addCommandHandler("apark",apark_func)
Alles anzeigen
Das ist mein Script. Das Problem ist nur, dass wenn ich /apark eingebe das im debugscript, Zeile 5 vioGetElementData ist eine nil value. Nur warum ? Ich meine ... es ist doch alles richtig. AUf einem VioScript ist es gestartet.