I made a little script that when a player hits the marker he gets a message about spraying grafitty, gives him money and the marker gets destroyed. My only problem is that i want to create like 30 of them and i dont want to copy them 30 times..
local myMarker = createMarker ( 588.2734375, -1532.080078125, 14.239238739014, "cylinder",1.7, 255, 0, 0, 100, source )
local x = createMarker ( 568.921875, -1360.4970703125, 13.930986404419, "cylinder",1.7, 255, 0, 0, 100, source )
function info(myMarker)
triggerClientEvent(myMarker,"aoutput",myMarker,"Informatie","Ai gasit un grafiti ascuns si ai primit 100 lei felicitari, poti spreia peste sau pleca mai departe.")
end
addEventHandler ( "onMarkerHit", myMarker, info )
addEventHandler ( "onMarkerHit", x, info )
function MarkerHit( thePlayer, matchingDimension, theCost )
exports.global:giveMoney(thePlayer, 1000)
destroyElement ( myMarker )
end
function z( thePlayer, matchingDimension, theCost )
exports.global:giveMoney(thePlayer, 1000)
destroyElement ( x )
end
addEventHandler( "onMarkerHit", x, z)
addEventHandler( "onMarkerHit", myMarker, MarkerHit )