Hi! I want to make a script like this: When you press '2' the engine will start and the sound too. There is my script and have 2 problems:
1.SCRIPT ERROR: OffEngine\server.lua:17: '<eof>' expected near 'end'
ERROR: Loading script failed: OffEngine\server.lua:17: '<eof>' expected near 'end'
2. ERROR: Client (#ff8000Name) triggered serverside event motor_event, but event is not added serverside
EDIT: Error 1, server.lua:17 is the last 'end' from Server Side
There is my Script:
Server Side:
function motor_fonskiyon()
local arac = getPedOccupiedVehicle(source)
if arac then
local aracadi = getVehicleName(arac)
if getVehicleEngineState(arac) == false then
setVehicleEngineState(arac, true)
outputChatBox("Engine on. Car: ["..aracadi.."]", source, 0, 153, 51, true)
startSound = playSound("files/starter.mp3", false)
elseif getVehicleEngineState(arac) == true then
setVehicleEngineState(arac, false)
outputChatBox("Engine off. Car: ["..aracadi.."]", source, 0, 153, 51, true)
end
end
end
end
addEvent("motor_event", true)
addEventHandler("motor_event", getRootElement(), motor_fonskiyon)
Meta.XML
<meta>
<info author="Name" name="Engine" version="1" type="script"/>
<script src="client.lua" type="client" cache="false"/>
<script src="server.lua" type="server"/>
<file src="files/starter.mp3" />
</meta>
Client Side:
I would be grateful if you could help me! Thanks