wesleywillems17 Posted August 29, 2014 Share Posted August 29, 2014 I have a problem with my drugs transport scripts. When i hit the marker i will get the money of: Los Santos, Las venturas and san fierro. How can i fix this? Server-side: function lsjobser () carLS = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle ( source, carLS ) markerLS = createMarker (979.65, -1261.75, 15.22, "cylinder", 2, 255, 0, 0, 255) blipLS = createBlipAttachedTo (markerLS, 51) 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(carLS) end end addEventHandler( "onMarkerHit", root, moneyLS ) function lvjobser () carlv = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(attacker, carlv) markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) blipLV = createBlipAttachedTo (markerLV, 51) 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 (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(source, carSF) markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) blipSF = createBlipAttachedTo (markerSF, 51) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) function moneySF (attacker) if (attacker) and (attacker ~= source) then givePlayerMoney(source, 10000) setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+6) destroyElement(markerSF) destroyElement(blipSF) destroyElement(carSF) end end addEventHandler( "onMarkerHit", root, moneySF ) Link to comment
Anubhav Posted August 29, 2014 Share Posted August 29, 2014 markers = {} vehicles = {} blips = {} function lsjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle ( source, vehicles[source] ) markers[source] = createMarker (979.65, -1261.75, 15.22, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) 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) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end end end addEventHandler( "onMarkerHit", resourceRoot, moneyLS ) function lvjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(attacker, vehicles[source]) markers[source] = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) end addEvent ("givePlayerJobLV", true) addEventHandler ("givePlayerJobLV", root, lvjobser) function sfjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(source, vehicles[source]) markers[source] = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) Link to comment
wesleywillems17 Posted August 29, 2014 Author Share Posted August 29, 2014 @Anubhav Does not work Link to comment
wesleywillems17 Posted September 1, 2014 Author Share Posted September 1, 2014 No errors but still i get all the money of all the locations when i only drive to LS. The scripts said i will get 3000$ dollar bet i around 19000$ -,- Link to comment
Anubhav Posted September 1, 2014 Share Posted September 1, 2014 markers = {} vehicles = {} blips = {} function lsjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle ( source, vehicles[source] ) markers[source] = createMarker (979.65, -1261.75, 15.22, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) end addEvent ("givePlayerJobLS", true) addEventHandler ("givePlayerJobLS", root, lsjobser) function moneyLS (attacker) if isTimer(cooldown) then return end if (attacker) and (attacker ~= source) then cooldown = setTimer(function() end, 1000, 1) givePlayerMoney(attacker, 3000) setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+2) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end end end addEventHandler( "onMarkerHit", resourceRoot, moneyLS ) function lvjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(attacker, vehicles[source]) markers[source] = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) end addEvent ("givePlayerJobLV", true) addEventHandler ("givePlayerJobLV", root, lvjobser) function sfjobser () if isElement(vehicles[source]) then destroyElement(vehicles[source]) end if isElement(blips[source]) then destroyElement(blips[source]) end if isElement(markers[source]) then destroyElement(markers[source]) end vehicles[source] = createVehicle (498, 1604.68, -1475.15, 13.93) warpPedIntoVehicle(source, vehicles[source]) markers[source] = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) blips[source] = createBlipAttachedTo (markers[source], 51) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) Link to comment
wesleywillems17 Posted September 2, 2014 Author Share Posted September 2, 2014 Still does not work When i choose los santos as my destination and when i drive to the marker and hot the marker. Then i receive the money of the destination Los Santos San Fierro and Las Venturas. When i drive to LS normally i would receive $3000 When i drive to LV normally i would receive $6000 When i drive to SF normally i would receive $10,000 3000+6000+10000=19000 So i receive $19000 for only driving to LS. 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