okay, the problem is you have to put event handler after marker is created, using onResourceStart looks like adding new thread, so you cant be sure if your marker will be created before or after adding onMarkerHit event.. do something like:
function load_ (name) -- i suggest not to use "load" as function name
outputDebugString("load_")
pilot = createPed (61,1712.6456298828,1617.2902832031,10.063969612122)
setPedRotation ( pilot, 169.0)
pilotmarker = createMarker ( 1712.4139404297,1616.1068115234,9.130989074707, "cylinder",1.5) -- its very hard to hit 1.0 marker.. i did it just once
addEventHandler("onMarkerHit", pilotmarker, function()
outputDebugString("hit pilot marker")
outputChatBox("Welcome to My Server", thePlayer)
end)
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), load_)
will be ok..
btw:
https://wiki.multitheftauto.com/wiki/Debugging
all your errors can be easly spotted:
http://i33.tinypic.com/nvcgif.png