Hi ich habe ein Problem mit dem script von Michelles Werkstat
Nämlich wenn ich mein Reallife Script neustarte
kommt Diese Meldung carsys/Michelles/Michelles_server.lua:10: 'then' expected near 'getElementModel'
Lua
setGarageOpen ( 45, true )
local thismarker = createMarker(-1786.96875, 1215.0228271484, 24, "cylinder", 5, 120, 0, 0, 100)
function showpaintmenue ( hitElement, matchingDimension )
if getElementType( hitElement ) == "vehicle" and matchingDimension then
if getVehicleOccupant ( hitElement, 0 ) == false and getVehicleOccupant ( hitElement, 1 ) == false and getVehicleOccupant ( hitElement, 2 ) == false and getVehicleOccupant ( hitElement, 3 ) == false then
local player = getVehicleOccupant ( hitElement )
if player then
if firevehs [getElementModel ( hitElement )] then
if copvehs [getElementModel ( hitElement )] then
if laGetElementData ( hitElement, "owner" ) then
if laGetElementData ( hitElement, "owner" ) == getPlayerName ( player ) then
setElementVelocity ( hitElement, 0, 0, 0 )
local thedim = math.random(500, 65000)
setElementDimension(player, thedim)
setElementDimension(hitElement, thedim)
setElementPosition(hitElement, -1786.8245, 1215.9442, 25.125)
triggerClientEvent ( player, "showpaintmenue", player )
local NT1 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningTL" )
local NT2 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningMU" )
outputLog ( "Spieler: "..getPlayerName ( player ).."; Aktion: showpaintmenue "..NT1..", "..NT2, "tuningshop" )
else
outputChatBox ( "Du kannst nur deine Privatfahrzeuge tunen!", player, 125, 0, 0 )
end
else
outputChatBox ( "Du kannst nur Privatfahrzeuge tunen!", player, 125, 0, 0 )
end
else
outputChatBox ( "Polizeifahrzeuge werden nicht getunt!", player, 125, 0, 0 )
end
else
outputChatBox ( "Feuerwehrfahrzeuge werden nicht getunt!", player, 125, 0, 0 )
end
end
end
end
end
addEventHandler ( "onMarkerHit", thismarker, showpaintmenue )
function setVehicleHandling_func (item, value)
local tow = getPlayerOccupiedVehicle( source )
local id = getElementModel(tow)
local this = getOriginalHandling ( id )
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]-0.2)
-- setVehicleHandling(tow, "suspensionUpperLimit", this["suspensionUpperLimit"])
-- setVehicleHandling(tow, "suspensionUpperLimit", this["suspensionUpperLimit"]+0.05*value)
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*value)
-- setVehicleHandling(tow, "suspensionUpperLimit", this["suspensionUpperLimit"]+0.05*value)
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*value)
setControlState(source, "backwards", true)
-- outputChatBox(this["suspensionLowerLimit"])
-- outputChatBox(this["suspensionLowerLimit"]+0.05*value)
-- outputChatBox(this["suspensionUpperLimit"])
-- outputChatBox(this["suspensionUpperLimit"]+0.05*value)
-- setControlState(source, "accelerate", true)
-- setTimer(setControlState, 500, 1, source, "accelerate", false)
setTimer(setControlState, 50, 1, source, "backwards", false)
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: setVehicleHandling "..value, "tuningshop" )
end
addEvent ( "setVehicleHandling", true)
addEventHandler ( "setVehicleHandling", getRootElement(), setVehicleHandling_func)
function cancelpaintshop (player)
local theVehicle = getPedOccupiedVehicle ( player )
setElementDimension(theVehicle, 0)
setElementDimension(player, 0)
showCursor(player, false)
local colors = laGetElementData ( getPedOccupiedVehicle(player), "color" )
local c1 = gettok ( colors, 1, string.byte( '|' ) )
local c2 = gettok ( colors, 2, string.byte( '|' ) )
local c3 = gettok ( colors, 3, string.byte( '|' ) )
local c4 = gettok ( colors, 4, string.byte( '|' ) )
if string.find ( c1, "," ) then
local c1a = gettok ( c1, 1, string.byte( ',' ) )
local c1b = gettok ( c1, 2, string.byte( ',' ) )
local c1c = gettok ( c1, 3, string.byte( ',' ) )
local c2a = gettok ( c2, 1, string.byte( ',' ) )
local c2b = gettok ( c2, 2, string.byte( ',' ) )
local c2c = gettok ( c2, 3, string.byte( ',' ) )
local c3a = gettok ( c3, 1, string.byte( ',' ) )
local c3b = gettok ( c3, 2, string.byte( ',' ) )
local c3c = gettok ( c3, 3, string.byte( ',' ) )
local c4a = gettok ( c4, 1, string.byte( ',' ) )
local c4b = gettok ( c4, 2, string.byte( ',' ) )
local c4c = gettok ( c4, 3, string.byte( ',' ) )
setVehicleColor ( getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
else
setVehicleColor ( getPedOccupiedVehicle(player), c1, c2, c3, c4 )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1, c2, c3, c4 )
end
local NT1 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningTL" )
local NT2 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningMU" )
local tow = getPlayerOccupiedVehicle( source )
local id = getElementModel(tow)
local this = getOriginalHandling ( id )
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*NT1)
setVehicleHandling(tow, "maxVelocity", this["maxVelocity"]+30/3*NT2)
setVehicleHandling(tow, "engineAcceleration", this["engineAcceleration"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
setVehicleHandling(tow, "engineInertia", this["engineInertia"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: cancelpaintshop "..NT1..", "..NT2, "tuningshop" )
end
addEvent ( "cancelpaintshop", true)
addEventHandler ( "cancelpaintshop", getRootElement(), cancelpaintshop)
function finishpaintshop ( player, veh, color )
local money = laGetElementData ( player, "money" )
if money >= 3000 then
takePlayerSaveMoney ( player, 3000 )
local slot = laGetElementData ( veh, "carslotnr_owner" )
local pname = MySQL_Save ( getPlayerName ( player ) )
triggerClientEvent ( player, "showcsinfo", player, "Spezil-Lackierung wurde erfolgreich gekauft.", 0, 255, 0)
if slot then
-- outputChatBox(pname)
MySQL_SetString("vehicles", "Farbe", color, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
laSetElementData ( veh, "color", color )
-- colors = color
-- local c1 = gettok ( colors, 1, string.byte( '|' ) )
-- local c2 = gettok ( colors, 2, string.byte( '|' ) )
-- local c3 = gettok ( colors, 3, string.byte( '|' ) )
-- local c4 = gettok ( colors, 4, string.byte( '|' ) )
-- if string.find ( c1, "," ) then
-- local c1a = gettok ( c1, 1, string.byte( ',' ) )
-- local c1b = gettok ( c1, 2, string.byte( ',' ) )
-- local c1c = gettok ( c1, 3, string.byte( ',' ) )
-- local c2a = gettok ( c2, 1, string.byte( ',' ) )
-- local c2b = gettok ( c2, 2, string.byte( ',' ) )
-- local c2c = gettok ( c2, 3, string.byte( ',' ) )
-- local c3a = gettok ( c3, 1, string.byte( ',' ) )
-- local c3b = gettok ( c3, 2, string.byte( ',' ) )
-- local c3c = gettok ( c3, 3, string.byte( ',' ) )
-- local c4a = gettok ( c4, 1, string.byte( ',' ) )
-- local c4b = gettok ( c4, 2, string.byte( ',' ) )
-- local c4c = gettok ( c4, 3, string.byte( ',' ) )
-- setVehicleColor ( veh, c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
-- setTimer ( setVehicleColor, 100, 1, veh, c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
-- else
-- setVehicleColor ( veh, c1, c2, c3, c4 )
-- setTimer ( setVehicleColor, 100, 1, veh, c1, c2, c3, c4 )
-- end
end
local theVehicle = getPedOccupiedVehicle ( player )
setElementDimension(theVehicle, 0)
setElementDimension(player, 0)
showCursor(player, false)
local colors = laGetElementData ( getPedOccupiedVehicle(player), "color" )
local c1 = gettok ( colors, 1, string.byte( '|' ) )
local c2 = gettok ( colors, 2, string.byte( '|' ) )
local c3 = gettok ( colors, 3, string.byte( '|' ) )
local c4 = gettok ( colors, 4, string.byte( '|' ) )
if string.find ( c1, "," ) then
local c1a = gettok ( c1, 1, string.byte( ',' ) )
local c1b = gettok ( c1, 2, string.byte( ',' ) )
local c1c = gettok ( c1, 3, string.byte( ',' ) )
local c2a = gettok ( c2, 1, string.byte( ',' ) )
local c2b = gettok ( c2, 2, string.byte( ',' ) )
local c2c = gettok ( c2, 3, string.byte( ',' ) )
local c3a = gettok ( c3, 1, string.byte( ',' ) )
local c3b = gettok ( c3, 2, string.byte( ',' ) )
local c3c = gettok ( c3, 3, string.byte( ',' ) )
local c4a = gettok ( c4, 1, string.byte( ',' ) )
local c4b = gettok ( c4, 2, string.byte( ',' ) )
local c4c = gettok ( c4, 3, string.byte( ',' ) )
setVehicleColor ( getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
else
setVehicleColor ( getPedOccupiedVehicle(player), c1, c2, c3, c4 )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1, c2, c3, c4 )
end
local NT1 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningTL" )
local NT2 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningMU" )
local tow = getPlayerOccupiedVehicle( source )
local id = getElementModel(tow)
local this = getOriginalHandling ( id )
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*NT1)
setVehicleHandling(tow, "maxVelocity", this["maxVelocity"]+30/3*NT2)
setVehicleHandling(tow, "engineAcceleration", this["engineAcceleration"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
setVehicleHandling(tow, "engineInertia", this["engineInertia"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop "..NT1..", "..NT2..", "..color, "tuningshop" )
else
-- infobox ( player, "\n\n\nDu hast nicht\ngenug Geld!", 7500, 125, 0, 0 )
triggerClientEvent ( player, "showcsinfo", player, "Du hast nicht genug Geld!", 255, 0, 0)
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop.NoMoney", "tuningshop" )
end
end
addEvent ( "finishpaintshop", true)
addEventHandler ( "finishpaintshop", getRootElement(), finishpaintshop)
function finishpaintshop1 ( player, veh, tl )
local preis = 999999999999 --<-- WEIL ICH ES KANN :D
local money = laGetElementData ( player, "money" )
if tl == 1 then
preis = 5000
elseif tl == 2 then
preis = 8000
elseif tl == 3 then
preis = 12000
elseif tl == 4 then
preis = 15000
elseif tl == 5 then
preis = 19500
end
-- outputChatBox(tl)
-- outputChatBox(preis)
if money >= preis then
takePlayerSaveMoney ( player, preis )
local slot = laGetElementData ( veh, "carslotnr_owner" )
local pname = MySQL_Save ( getPlayerName ( player ) )
triggerClientEvent ( player, "showcsinfo", player, "Tieferlegung wurde erfolgreich gekauft.", 0, 255, 0)
if slot then
MySQL_SetString("vehicles", "NewTuningTL", tl, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
laSetElementData ( veh, "NewTuningTL", tl )
end
local theVehicle = getPedOccupiedVehicle ( player )
setElementDimension(theVehicle, 0)
setElementDimension(player, 0)
showCursor(player, false)
local colors = laGetElementData ( getPedOccupiedVehicle(player), "color" )
local c1 = gettok ( colors, 1, string.byte( '|' ) )
local c2 = gettok ( colors, 2, string.byte( '|' ) )
local c3 = gettok ( colors, 3, string.byte( '|' ) )
local c4 = gettok ( colors, 4, string.byte( '|' ) )
if string.find ( c1, "," ) then
local c1a = gettok ( c1, 1, string.byte( ',' ) )
local c1b = gettok ( c1, 2, string.byte( ',' ) )
local c1c = gettok ( c1, 3, string.byte( ',' ) )
local c2a = gettok ( c2, 1, string.byte( ',' ) )
local c2b = gettok ( c2, 2, string.byte( ',' ) )
local c2c = gettok ( c2, 3, string.byte( ',' ) )
local c3a = gettok ( c3, 1, string.byte( ',' ) )
local c3b = gettok ( c3, 2, string.byte( ',' ) )
local c3c = gettok ( c3, 3, string.byte( ',' ) )
local c4a = gettok ( c4, 1, string.byte( ',' ) )
local c4b = gettok ( c4, 2, string.byte( ',' ) )
local c4c = gettok ( c4, 3, string.byte( ',' ) )
setVehicleColor ( getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
else
setVehicleColor ( getPedOccupiedVehicle(player), c1, c2, c3, c4 )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1, c2, c3, c4 )
end
local NT1 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningTL" )
local NT2 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningMU" )
local tow = getPlayerOccupiedVehicle( source )
local id = getElementModel(tow)
local this = getOriginalHandling ( id )
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*NT1)
setVehicleHandling(tow, "maxVelocity", this["maxVelocity"]+30/3*NT2)
setVehicleHandling(tow, "engineAcceleration", this["engineAcceleration"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
setVehicleHandling(tow, "engineInertia", this["engineInertia"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop "..NT1..", "..NT2..", "..tl, "tuningshop" )
else
-- infobox ( player, "\n\n\nDu hast nicht\ngenug Geld!", 7500, 125, 0, 0 )
triggerClientEvent ( player, "showcsinfo", player, "Du hast nicht genug Geld!", 255, 0, 0)
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop1.NoMoney ", "tuningshop" )
end
end
addEvent ( "finishpaintshop1", true)
addEventHandler ( "finishpaintshop1", getRootElement(), finishpaintshop1)
function output (player)
local tow = getPlayerOccupiedVehicle( player )
local id = getElementModel(tow)
local this1 = getOriginalHandling ( id )
local this2 = getVehicleHandling ( tow )
outputChatBox(this1["maxVelocity"])
outputChatBox(this1["maxVelocity"]+30/3*3)
outputChatBox(this2["maxVelocity"])
end
-- addCommandHandler("op", output)
function finishpaintshop2 ( player, veh, mu )
-- outputChatBox("-.-")
local preis = 999999999999
local money = laGetElementData ( player, "money" )
if mu == 1 then
preis = 15000
elseif mu == 2 then
preis = 20000
elseif mu == 3 then
preis = 35000
end
if money >= preis then
takePlayerSaveMoney ( player, preis )
local slot = laGetElementData ( veh, "carslotnr_owner" )
local pname = MySQL_Save ( getPlayerName ( player ) )
triggerClientEvent ( player, "showcsinfo", player, "Spezial-Motor wurde erfolgreich gekauft.", 0, 255, 0)
if slot then
MySQL_SetString("vehicles", "NewTuningMU", mu, "Besitzer LIKE '" ..pname.."' AND Slot LIKE '" ..slot.. "' ")
laSetElementData ( veh, "NewTuningMU", mu )
end
local theVehicle = getPedOccupiedVehicle ( player )
setElementDimension(theVehicle, 0)
setElementDimension(player, 0)
showCursor(player, false)
local colors = laGetElementData ( getPedOccupiedVehicle(player), "color" )
local c1 = gettok ( colors, 1, string.byte( '|' ) )
local c2 = gettok ( colors, 2, string.byte( '|' ) )
local c3 = gettok ( colors, 3, string.byte( '|' ) )
local c4 = gettok ( colors, 4, string.byte( '|' ) )
if string.find ( c1, "," ) then
local c1a = gettok ( c1, 1, string.byte( ',' ) )
local c1b = gettok ( c1, 2, string.byte( ',' ) )
local c1c = gettok ( c1, 3, string.byte( ',' ) )
local c2a = gettok ( c2, 1, string.byte( ',' ) )
local c2b = gettok ( c2, 2, string.byte( ',' ) )
local c2c = gettok ( c2, 3, string.byte( ',' ) )
local c3a = gettok ( c3, 1, string.byte( ',' ) )
local c3b = gettok ( c3, 2, string.byte( ',' ) )
local c3c = gettok ( c3, 3, string.byte( ',' ) )
local c4a = gettok ( c4, 1, string.byte( ',' ) )
local c4b = gettok ( c4, 2, string.byte( ',' ) )
local c4c = gettok ( c4, 3, string.byte( ',' ) )
setVehicleColor ( getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1a, c1b, c1c, c2a, c2b, c2c, c3a, c3b, c3c, c4a, c4b, c4c )
else
setVehicleColor ( getPedOccupiedVehicle(player), c1, c2, c3, c4 )
setTimer ( setVehicleColor, 100, 1, getPedOccupiedVehicle(player), c1, c2, c3, c4 )
end
local NT1 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningTL" )
local NT2 = laGetElementData ( getPedOccupiedVehicle(player), "NewTuningMU" )
local tow = getPlayerOccupiedVehicle( source )
local id = getElementModel(tow)
local this = getOriginalHandling ( id )
setVehicleHandling(tow, "suspensionLowerLimit", this["suspensionLowerLimit"]+0.05*NT1)
setVehicleHandling(tow, "maxVelocity", this["maxVelocity"]+30/3*NT2)
setVehicleHandling(tow, "engineAcceleration", this["engineAcceleration"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
setVehicleHandling(tow, "engineInertia", this["engineInertia"]/this["maxVelocity"]*(this["maxVelocity"]+100/3*NT2))
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop "..NT1..", "..NT2..", "..mu, "tuningshop" )
else
-- infobox ( player, "\n\n\nDu hast nicht\ngenug Geld!", 7500, 125, 0, 0 )
triggerClientEvent ( player, "showcsinfo", player, "Du hast nicht genug Geld!", 255, 0, 0)
outputLog ( "Spieler: "..getPlayerName ( source ).."; Aktion: finishpaintshop2.NoMoney ", "tuningshop" )
end
end
addEvent ( "finishpaintshop2", true)
addEventHandler ( "finishpaintshop2", getRootElement(), finishpaintshop2)
Alles anzeigen