VenomOG Posted April 30, 2018 Share Posted April 30, 2018 Hey I need help When I do addeventhandler(onmarkerhit", job marker, moneyls) when anyone enters any marker it gives them $ Link to comment
iPrestege Posted April 30, 2018 Share Posted April 30, 2018 Parameters element hitElement, bool matchingDimension hitElement: the element that hit the marker. matchingDimension: a boolean representing whether the element is in the same dimension as the marker. Source The source of this event is the marker that got hit by the element Also what about show us the part of your code that your having a problem with? Link to comment
VenomOG Posted April 30, 2018 Author Share Posted April 30, 2018 function lsjobser () car = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, car) markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255) blipLS = createBlipAttachedTo (markerLS, 40) end addEvent ("givePlayerJobLS", true) addEventHandler ("givePlayerJobLS", root, lsjobser) function moneyLS (attacker) if (attacker) and (attacker ~= source) then givePlayerMoney(attacker, 3000) setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+2) destroyElement(markerLS) destroyElement(blipLS) destroyElement(car) end end addEventHandler( "onMarkerHit", root, moneyLS ) function lvjobser () carlv = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, carlv) markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) blipLV = createBlipAttachedTo (markerLV, 40) end addEvent ("givePlayerJobLV", true) addEventHandler ("givePlayerJobLV", root, lvjobser) function moneyLV (attacker) if (attacker) and (attacker ~= source) then givePlayerMoney(attacker, 6000) setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+4) destroyElement(markerLV) destroyElement(blipLV) destroyElement(carlv) end end addEventHandler( "onMarkerHit", root, moneyLV ) function sfjobser () carSF = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, carSF) markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) blipSF = createBlipAttachedTo (markerSF, 40) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) function moneySF (attacker) if (attacker) and (attacker ~= source) then givePlayerMoney(attacker, 10000) setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+6) destroyElement(markerSF) destroyElement(blipSF) destroyElement(carSF) end end addEventHandler( "onMarkerHit", root, moneySF ) Link to comment
iPrestege Posted April 30, 2018 Share Posted April 30, 2018 (edited) You should use tables to create 'VEHICLES,MARKERS And Blips' For each player in the server side. Also check the wiki for the 'onMarkerHit' Event handler. Good luck! Edited April 30, 2018 by iPrestege 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