Lloyd Logan Posted January 18, 2013 Posted January 18, 2013 Hey, so i created a paynspray script but when the Element leaves the Marker, it continues to repair the car? Nothing in db 3, it doesn't cancel the script? Thanks Server dutymarker = createMarker(1911.35938, -1777.46899, 11.98387, "cylinder", 4.0, 255, 255, 155) function paynspray(hitElement,matchingDimension) if (hitElement and getElementType(hitElement) == "player" and matchingDimension) then local money = getPlayerMoney(hitElement) if ( money>=500 ) then outputChatBox("Please wait whilst we work on your vehicle!", hitElement) setTimer (fixVehicle, 5000, 1, getPedOccupiedVehicle(hitElement)) setTimer ( outputChatBox, 5000, 1, "Thank you for for coming to us for your repair!" ) else outputChatBox("Please come back when you have atleast $500, thank you", hitElement) end end end addEventHandler("onMarkerHit", dutymarker, paynspray) Client function markerLeave( leaveElement, matchingDimension ) cancelEvent("onMarkerHit", leaveElement, paynspray) outputChatBox("Wait! What about your repair?", hitElement) end addEventHandler( "onMarkerLeave", leaveElement, markerLeave )
psydomin Posted January 18, 2013 Posted January 18, 2013 just try making it only on server side, it is easier in this case
Lloyd Logan Posted January 18, 2013 Author Posted January 18, 2013 just try making it only on server side, it is easier in this case How would i cancel the event server side?
iPrestege Posted January 18, 2013 Posted January 18, 2013 just try making it only on server side, it is easier in this case How would i cancel the event server side? cancel event Client and Server function and you use OnMarkerLeave? at client it,s Serverside event you can use: onClientMarkerLeave
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 just try making it only on server side, it is easier in this case How would i cancel the event server side? cancel event Client and Server function and you use OnMarkerLeave? at client it,s Serverside event you can use: onClientMarkerLeave That was hard for me to understand, what your saying is to use "onClientMarkerLeave"?
iPrestege Posted January 19, 2013 Posted January 19, 2013 You say this is the client side : function markerLeave( leaveElement, matchingDimension ) cancelEvent("onMarkerHit", leaveElement, paynspray) outputChatBox("Wait! What about your repair?", hitElement) end addEventHandler( "onMarkerLeave", leaveElement, markerLeave ) yes? onMarkerLeave it,s ServerSide Only! Thats What i mean and i give you the clientSide Event
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 You say this is the client side : function markerLeave( leaveElement, matchingDimension ) cancelEvent("onMarkerHit", leaveElement, paynspray) outputChatBox("Wait! What about your repair?", hitElement) end addEventHandler( "onMarkerLeave", leaveElement, markerLeave ) yes? onMarkerLeave it,s ServerSide Only! Thats What i mean and i give you the clientSide Event Thank you!
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