Client (JasoN) triggered serverside event onPilotJobAnnehm, but event is not added serverside
Pilot_Client.lua :
Lua
addEventHandler("onClientGUIClick", Knopf1,
function()
Guivar = 0
showCursor(false)
destroyElement(Fenster)
triggerServerEvent("onPilotJobAnnehm", gMe)
destroyElement(Marker)
setTimer(createJobPilotFlug, jobRespawnDelay*60*1000, 1)
end, false)
Pilot_Server.lua :
Lua
addEvent("onPilotJobAnnehm", true)
addEventHandler("onPilotJobAnnehm", getRootElement(),
function()
if(getElementData(source, "inJob") == true) then outputChatBox("Du bist bereits in einem Job!", source, 200, 0, 0, false) return end
setElementData(source, "inJob", true)
setElementData(source, "jobPilot", true)
pVeh[source] = createVehicle(getVehicleModelFromName(getElementData(source, "JOBPILOTVEH")), -1636.4000244141, -144, 14.89999961853)
triggerClientEvent(getRootElement(), "onGhostmodeSet", source, pVeh[source])
setElementRotation(pVeh[source], 0, 0, 315.24987792969)
setElementData(pVeh[source], "Besitzer", getPlayerName(source))
addEventHandler("onVehicleEnter", pVeh[source], check_job_trailer_attach)
addEventHandler("onVehicleExplode", pVeh[source],
function()
local lolp = getElementData(source, "Besitzer")
local playa = getPlayerFromName(lolp)
if not(playa) then destroyElement(source) return end
if(getElementData(playa, "inJob") == true) and (getElementData(playa, "jobPilot") == true) then
destroyElement(pVeh[playa])
destroyElement(pBlip[playa])
destroyElement(pMarker[playa])
setElementData(playa, "inJob", false)
setElementData(playa, "jobPilot", false)
triggerClientEvent(playa, "respawnPlayerJobPilot", playa)
outputChatBox("Job abgebrochen! Dein Flugzeug ist Explodiert.", playa, 200, 0, 0)
end
end)
end)
Alles anzeigen