FranklinRoosevelt Posted May 9, 2014 Share Posted May 9, 2014 function createcooking (x, y, z) marker = createMarker(x, y+1, z, "cylinder", 1) end addEvent ( "createCook", true ) addEventHandler ( "createCook", root, createcooking ) function onmarker(source, matchingDimension) triggerClientEvent ( "onCook", getRootElement(), source ) end addEventHandler( "onMarkerHit", marker, onmarker ) Explain why does not work, must use marker created during the game. sorry for my English Link to comment
justn Posted May 9, 2014 Share Posted May 9, 2014 (edited) Can you post the part where you triggered the event 'createCook' ? also, you don't need to define source in a server-sided function. Edited May 9, 2014 by Guest Link to comment
TAPL Posted May 9, 2014 Share Posted May 9, 2014 function createcooking(x, y, z) marker = createMarker(x, y+1, z, "cylinder", 1) addEventHandler("onMarkerHit", marker, onmarker) end addEvent("createCook", true) addEventHandler("createCook", root, createcooking) function onmarker(player) if getElementType(player) == "player" then triggerClientEvent("onCook", root, player) end end Link to comment
FranklinRoosevelt Posted May 9, 2014 Author Share Posted May 9, 2014 function createcooking(x, y, z) marker = createMarker(x, y+1, z, "cylinder", 1) addEventHandler("onMarkerHit", marker, onmarker) end addEvent("createCook", true) addEventHandler("createCook", root, createcooking) function onmarker(player) if getElementType(player) == "player" then triggerClientEvent("onCook", root, player) end end thank you verry much! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now