darhal Posted September 28, 2013 Share Posted September 28, 2013 Hi all I have this taxi job that I made it work all work but when I deliver the client at his place the next merker and the blip dont shown I dk why I really get nervous about this plz help me !! client side : function beginTransport(player, seat) local mod = getElementModel(source) if (seat ~= 0 or player ~= localPlayer) then return end if (getElementData(localPlayer, "Occupation") == "Taxi Driver") then if (isElement(deliverMarker) or isElement(startMarker)) then return end if (mod == 420 or mod == 438) then local val = math.random(#locations) local mX, mY, mZ = locations[val][1], locations[val][2], locations[val][3] local area, city = getZoneName(mX, mY, mZ), getZoneName(mX, mY, mZ, true) startMarker = createMarker(mX, mY, mZ - 1, "cylinder", 3, 255, 255, 0, 100) startBlip = createBlipAttachedTo(startMarker, 41) addEventHandler("onClientMarkerHit", startMarker, enteredStartMarker) exports.UIPtexts:output("Drive to "..area..", "..city.." and pick up the client", 255, 255, 0) end end end addEventHandler("onClientVehicleEnter", root, beginTransport) function enteredStartMarker(plr) if (plr ~= localPlayer) then return end if (not isPedInVehicle(plr)) then return end local v = getPedOccupiedVehicle(plr) local m = getElementModel(v) if (m == 420 or m == 438) then destroyElement(source) if (isElement(startBlip)) then destroyElement(startBlip) end local i = math.random(#deliveries) local mX, mY, mZ = deliveries[i][1], deliveries[i][2], deliveries[i][3] local pX, pY, pZ = getElementPosition(localPlayer) local area, city = getZoneName(mX, mY, mZ), getZoneName(mX, mY, mZ, true) exports.UIPtexts:output("The client wants to go to "..area..", "..city.." drive there and deliver the client to get paid", 255, 255, 0) distance = getDistanceBetweenPoints2D(mX, mY, pX, pY) deliverMarker = createMarker(mX, mY, mZ, "cylinder", 3, 255, 255, 0, 150) deliverBlip = createBlipAttachedTo(deliverMarker, 41) addEventHandler("onClientMarkerHit", deliverMarker, enteredDeliverMarker) triggerServerEvent("CUPtaxi.warpPed", root, v) end end function enteredDeliverMarker(plr) if (plr ~= localPlayer) then return end if (not isPedInVehicle(plr)) then return end local v = getPedOccupiedVehicle(plr) local m = getElementModel(v) if (m == 420 or m == 438) then destroyElement(source) if (not distance) then return end if (isElement(deliverBlip)) then destroyElement(deliverBlip) end triggerServerEvent("CUPtaxi.finishJob", root, math.floor(distance)) distance = nil end end function destroy() if (isElement(deliverBlip) and isElement(deliverMarker)) then destroyElement(deliverBlip) destroyElement(deliverMarker) end if (isElement(startMarker) and isElement(startBlip)) then destroyElement(startMarker) destroyElement(startBlip) end end addEvent("onClientResign", true) addEvent("onClientPlayerEndDuty", true) addEventHandler("onClientResign", root, destroy) addEventHandler("onClientPlayerEndDuty", root, destroy) server side local ped = {} local payment = {} function warpPed(veh) if (not isElement(client)) then return end if (not isElement(veh)) then return end local p = createPed(math.random(1, 200), 1, 1, 1) if (not p) then p = createPed(3, 1, 1, 1) end ped[client] = p warpPedIntoVehicle(ped[client], veh, 2 or 3) setVehicleTaxiLightOn(veh, true) end addEvent("CUPtaxi.warpPed", true) addEventHandler("CUPtaxi.warpPed", root, warpPed) function getPay(player) if (payment[player]) then return payment[player][1], payment[player][2] else return 0, 0 end end function finishJob(dist) if (not isElement(client)) then return end local v = getPedOccupiedVehicle(client) if (not isElement(v)) then return end local pay = math.floor(dist) + 150 if (not payment[client]) then payment[client] = {0, 0} end local money = payment[client][1] or 0 local amount = payment[client][2] or 0 payment[client] = {money + pay, amount + 1} --exports.UIPaccounts:GPM(client, pay, "UIPtaxi finished job", true) exports.UIPtexts:output("You have deliveried the client to his location", client, 0, 255, 0) fadeCamera(client, false, 0) setElementFrozen(v, true) if (isElement(ped[client])) then destroyElement(ped[client]) end setTimer(fadeCamera, 1500, 1, client, true) setTimer(setElementFrozen, 1500, 1, v, false) setVehicleTaxiLightOn(v, false) local job = exports.UIPbusiness:getPlayerJob(client) --exports.UIPstats:addPlayerStat(client, job, 1) end addEvent("CUPtaxi.finishJob", true) addEventHandler("CUPtaxi.finishJob", root, finishJob) function givePaymentOnEndJob(jobName) if (jobName == "Taxi Driver") then if (payment[source]) then local m = payment[source][1] or 0 local amount = payment[source][2] or 0 local m = math.floor(m) payment[source] = nil exports.UIPbusiness:addPayment(source, m) exports.UIPaccounts:GPM(source, m, "UIPtaxi ended shift "..amount.." deliveries", true) exports.UIPtexts:output("You have ended your taxi shift and made $"..m.." from "..amount.." deliveries", source, 0, 255, 0) end end end addEvent("onPlayerResign", true) addEventHandler("onPlayerResign", root, givePaymentOnEndJob) addEvent("onPlayerEndDuty", true) addEventHandler("onPlayerEndDuty", root, givePaymentOnEndJob) function givePaymentOnQuitLogout() if (payment[source]) then exports.UIPbusiness:addPayment(source, payment[source][1] or 0) exports.UIPaccounts:GPM(source, payment[source][1] or 0, "UIPtaxi ended shift (quit)") end end addEventHandler("onPlayerLogout", root, givePaymentOnQuitLogout) addEventHandler("onPlayerQuit", root, givePaymentOnQuitLogout) function destroyPed() if (ped[source]) then if (isElement(ped[source])) then destroyElement(ped[source]) end end end addEvent("onPlayerResign", true) addEvent("onPlayerEndDuty", true) addEventHandler("onPlayerQuit", root, destroyPed) addEventHandler("onPlayerLogout", root, destroyPed) addEventHandler("onPlayerWasted", root, destroyPed) addEventHandler("onPlayerResign", root, destroyPed) addEventHandler("onPlayerEndDuty", root, destroyPed) plz help me urgent when I delive the client the next marker + the blip dont shown in map I think the problem here function destroy() if (isElement(deliverBlip) and isElement(deliverMarker)) then destroyElement(deliverBlip) destroyElement(deliverMarker) end if (isElement(startMarker) and isElement(startBlip)) then destroyElement(startMarker) destroyElement(startBlip) end t/debugscript 3 dont say nothing Link to comment
Castillo Posted September 28, 2013 Share Posted September 28, 2013 I don't think that the script is yours, as it says "UIP" all over. Also, if you had made it, then you would know that the script is not giving another destination after finish. Link to comment
darhal Posted September 29, 2013 Author Share Posted September 29, 2013 In fact a friend have a server called uip and he give me some resources an he say to dont change the script name he help me to make this taxi job but this bug happen and i need help fast to fix it he say that he will not help me more cuz he is busy so castilo can u help me plz i m newbie scripter Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 First you said that it was yours, now you say that someone gave it, wanna know what I think? that is a leaked script and you don't have permission to use it. 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