Hallo,
ich bin gerade dabei die Mechaniker Fraktion aufzuwerten, dabei habe ich eine umparkfunktion für die Mechaniker eingebaut, aber sie funktioniert nicht tatellos.
ich bekomme keine Errors nur die aussage "du bist kein Mechaniker" bin aber on duty und mechaniker, alle anderen Funktionen eines Mechanikers gehen auch.
hier das script:
Lua: Mechaniker_server.lua
function umparken_func ( player, command )
if getPedOccupiedVehicleSeat ( player ) == 0 then
if isElement ( veh ) then
if (isMechaniker(player)) and (isEmergencyOnDuty(player)) 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 umgeparkt!", 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 ) or 3
local Benzin = vioGetElementData ( veh, "fuelstate" )
local owner = vioGetElementData ( veh, "owner" )
local Distance = vioGetElementData ( veh, "distance" )
local slot = vioGetElementData ( veh, "carslotnr_owner" )
outputChatBox ( "Dein Fahrzeug in"..slot.."wurde abgeschleppt!", owner, 125, 0, 0 )
dbExec ( handler, "UPDATE vehicles SET Spawnpos_X=?, Spawnpos_Y=?, Spawnpos_Z=?, Spawnrot_X=?, Spawnrot_Y=?, Spawnrot_Z=?, Farbe=?, Paintjob=?, Benzin=?, Distance=? WHERE UID=? AND Slot=?", Spawnpos_X, Spawnpos_Y, Spawnpos_Z, Spawnrot_X, Spawnrot_Y, Spawnrot_Z, color, Paintjob, Benzin, Distance, thePlayerUID[owner], slot )
end
else
outputChatBox ( "Du bist kein Mechaniker", player, 255, 0, 0 )
end
else
outputChatBox ( "Du musst in einem Fahrzeug sitzen!", player, 255, 0, 0 )
end
end
addCommandHandler ( "umparken", umparken_func )
Alles anzeigen
es wäre nett wenn ihr mir da helfen könnt da es mich aktuell an weiteren arbeiten aufhält.
mfg
NovaScope