darhal Posted September 29, 2013 Share Posted September 29, 2013 السلام عليكم و رحمة اللع اما بعد انا صنعت انا و صديق ليا هذا الكود لوظيفة سائق الاجرة الكود يشتغل كويس بس عندما اخذ الزبون و اوصله الماركر و البلب التالية ما تظهر بلييييييز مساعدة لأني حاولت وحدي و ما قدرت و شكراا 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
S4MuEL Posted September 29, 2013 Share Posted September 29, 2013 سويت مع صديقك هآذي آلأكوآد , ولآ قدرت تصلح آلبلآيب سبحآنك يَ ربي .. وآللغة آلعربية في خطر نوعآ مآ Link to comment
darhal Posted September 29, 2013 Author Share Posted September 29, 2013 هو اللي سوا شطر الكود هو اجنابي ما يبي يساعدني ثاني Link to comment
S4MuEL Posted September 29, 2013 Share Posted September 29, 2013 آح آح آح , قل وآلله آلكود مزروف آعتقد .. Link to comment
Stranger Posted September 29, 2013 Share Posted September 29, 2013 try this 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("onClientVehicleStartEnter", 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) Link to comment
#DRAGON!FIRE Posted September 29, 2013 Share Posted September 29, 2013 Ech 8ayrt ? # اولأ تكلم عربي , ثاني شي مدامه صديقكـ مسوي كل ذا الكود اعتقد يقدر يسوي طلبكـ # + نحنا كيف نعدل على كود مو لنا وطويل .. م نفهم كثير Link to comment
Stranger Posted September 29, 2013 Share Posted September 29, 2013 Ech 8ayrt ? انت جربته ؟ Link to comment
darhal Posted September 30, 2013 Author Share Posted September 30, 2013 لا بس انت متاكد انو راح يشتغل ? Link to comment
aL.Kfo Posted September 30, 2013 Share Posted September 30, 2013 لا بس انت متاكد انو راح يشتغل ? جرب مو لزم يتاكد لك لا م اشتغل اطرح الرد ب المشكله و يفيدك Link to comment
فاّرس Posted September 30, 2013 Share Posted September 30, 2013 (edited) والي ما فهم وش تبي ؟ وما تخش العقل الكود بكبره الي سواه ما يقدر يعدله؟ ._. , الا اذا مزروف هذي مشكله ثانيه Edited October 1, 2013 by Guest Link to comment
Mr.Beshr Posted September 30, 2013 Share Posted September 30, 2013 معلومة بسيطة الحرامي او المجرم بشكل عام اذا فعل جريمته يخفي الأدلة انت ما شاء الله عيني عينك أول شي كاتب لي بالعربي وفي نص الرد plz help me urgent when I delive the client the next marker + the blip dont shown in map I think the problem here ذذ وضع يشكك صح ؟ Link to comment
iMr.Dawix~# Posted October 1, 2013 Share Posted October 1, 2013 '' ليس العيب ان تخطئ ولكن العيب ان تخطئ وتستمر بخطأك '' Link to comment
apple700 Posted October 1, 2013 Share Posted October 1, 2013 اي والله صادق يا ضاوي صح لسانك يا بطل الكود مسروق من مود اجنبي عيب نعدل عليه وهو مو لنا اذا عطيناك الي تبيه بناخذ اثم معك 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