Jump to content

ممكن اصلاح هذا الكود


Recommended Posts

سلام عليكم

هذا الكود تبع وظيفة توصيل البيتزا

لكن لا تظهر علامات على الغريطة برغم انى وضعت Blip

ممكن الحل من المحترفين :)

client

local blip = createBlip ( 1544.63257, 676.23987, 11.32813, 56 ) -- العلامة 
local jobped = createPed ( 287, 1544.63257, 676.23987, 11.32813, 90 ) -- الشخصية
local getjobmarker = createMarker ( 1544.63257, 676.23987, 11.32813 -1, "cylinder", 3, 255, 255, 255, 255 )
local destinations =  
{
    { 2810.92505, 2918.13208, 36.50460, 51 }; --------- مكان التوصيل
    { 1238.26147, 235.15599, 19.55469, 51 }; ----------
    { 2827.1000976563, 1383.5, 9.8000001907349, 51 }; -------- مكان التوصيل
    { 2495.5, 2773.3000488281, 9.8000001907349, 51 }; -------- مكان التوصيل
    { -2130.6999511719, -80.099998474121, 34.299999237061, 51 }; -------- مكان التوصيل
    { -2643.6000976563, 1373, 5.9000000953674, 51 }; -------- مكان التوصيل
    { -2747.1000976563, -280, 6, 51 }; -------- مكان التوصيل
    {  2339.97876, 2036.61914, 10.42309, 51 }; -------- مكان التوصيل
    {  1069.39612, 1226.58252, 10.23718, 51 }; -------- مكان التوصيل
}
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Memo = {}
GUIEditor_Label = {}
GUIEditor_Image = {}
 
addEventHandler("onResourceStart",destinations,
function unpackDestinations ()
 
    return unpack ( destinations [ math.random ( #destinations ) ] )
end)
 
addEventHandler("onResourceStart",getjobmarker,
function(p)
    if p == lp and not isPedInVehicle(lp) then
        guiSetVisible(getjobmarker,true)
        showCursor(true)
    end
end)
 
sx,sy = guiGetScreenSize()
lp = getLocalPlayer()
mr = math.random(1,2)
jobwindow = guiCreateWindow(157, 95, 530, 441, "Pizza Job", false)
guiWindowSetSizable(jobwindow, false)
guiSetAlpha(jobwindow, 1.00)
GUIEditor_Image[1] = guiCreateStaticImage(9, 24, 265, 236,"darbka.jpeg",false,jobwindow)
 
memo = guiCreateMemo(275, 22, 244, 240, "welcome to the jop", false, jobwindow)
 
label1 = guiCreateLabel(8,302,515,28,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", false, jobwindow)
guiLabelSetColor(label1,0,255,0,255)
guiSetFont(label1,"sa-header")
 
GUIEditor_Label[4] = guiCreateLabel(8,308,515,28,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",false,jobwindow)
guiLabelSetColor(GUIEditor_Label[4],255,0,0,255)
guiSetFont(GUIEditor_Label[4],"sa-header")
 
takebutton = guiCreateButton(10,378,166,54,"Get Job",false,jobwindow)
guiSetFont(takebutton,"clear-normal")
setTimer(function()
guiSetProperty(takebutton, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
 
 
cancbutton = guiCreateButton(353,378,166,54,"Close",false,jobwindow)
guiSetFont(cancbutton,"clear-normal")
setTimer(function()
guiSetProperty(cancbutton, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
 
GUIEditor_Label[5] = guiCreateLabel(336,266,168,53,"Helps",false,jobwindow)
guiLabelSetColor(GUIEditor_Label[5],255,0,0,255)
guiSetFont(GUIEditor_Label[5],"sa-gothic")
 
GUIEditor_Label[2] = guiCreateLabel(54,266,168,53,"Pizza Job",false,jobwindow)
guiLabelSetColor(GUIEditor_Label[2],255,0,0,255)
guiSetFont(GUIEditor_Label[2],"sa-gothic")
 
guiSetVisible (jobwindow,false)
guiMemoSetReadOnly(memo,true)
guiWindowSetMovable (jobwindow,true )
guiWindowSetSizable (jobwindow,false )
 
sx, sy = guiGetScreenSize()
lp = getLocalPlayer()
mr = math.random(1,2)
destinationwindow = guiCreateWindow(211,313,297,148, "Pizza Job", false)
guiSetAlpha(destinationwindow, 1.00)
 
 
label1 = guiCreateLabel(50,33,212,32, "Do you want to continue to The work ?", false, destinationwindow)
guiSetFont(label1, "default-bold-small")
 
continue = guiCreateButton(9,90,127,49, "Continue Work", false, destinationwindow)
guiSetProperty(continue, "NormalTextColour", "FFAAAAAA")
setTimer(function()
guiSetProperty(continue, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
 
close = guiCreateButton(165,90,123,49, "Stop Work", false, destinationwindow)
guiSetProperty(close, "NormalTextColour", "FFAAAAAA")  
setTimer(function()
guiSetProperty(close, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
 
guiMemoSetReadOnly(destinationmemo, true)
guiWindowSetSizable(destinationwindow, false)
guiWindowSetMovable(destinationwindow, true)
guiSetVisible (destinationwindow, false)
--
addEventHandler("onClientGUIClick",jobwindow,
function(b,thePlayer)
    if b == "left" then
        if source == takebutton then
            outputChatBox ("you has been Successfully took pizza job",0,255,0, true)
            outputChatBox ("Please back to the marker to get the Vehicle",0,255,0, true)
            guiSetVisible(jobwindow,false)
            guiSetVisible(takebutton,false)
            triggerServerEvent ( "doSomething", lp)
            showCursor(false)
            --
            onduty = guiCreateButton(10, 327, 166, 47, "get Vehicle", false, jobwindow)
            guiSetFont(onduty,"clear-normal")  
            setTimer(function()
guiSetProperty(onduty, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
           
           
            quitbutton = guiCreateButton(353, 327, 166, 47, "Quit Job", false, jobwindow)
            guiSetFont(quitbutton,"clear-normal")
            setTimer(function()
guiSetProperty(quitbutton, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
         
            end
        end
    end
)
 
addEventHandler("onClientGUIClick",jobwindow,
function(b,thePlayer)
    if b == "left" then
        if source == cancbutton then
        guiSetVisible(jobwindow,false)
        showCursor(false)
    end
  end
end)
 
addEventHandler("onClientGUIClick",jobwindow,
function(b,thePlayer)
    if b == "left" then
        if source == quitbutton then
        outputChatBox ("Please back to the marker to get the Vehicle",0,255,0, true)
        guiSetVisible(jobwindow,false)
        guiSetVisible(quitbutton,false)
        guiSetVisible(onduty,false)
        guiSetVisible(offduty,false)
        guiSetVisible(cancbutton,true)
        guiSetVisible(takebutton,true)
        triggerServerEvent ( "doSomethin", lp)
        showCursor(false)
        destroyElement ( truckerMarker )
        destroyElement ( truckerBlip )
    end
  end
end)
   
addEventHandler("onClientGUIClick",jobwindow,
function(b,thePlayer)
    if b == "left" then
        if source == onduty then
        outputChatBox ("Go to a mark that appeared to you the map ",source,0,255,0, true)
        triggerServerEvent ( "HaveTruckerJob", lp)
        triggerServerEvent ( "sum", lp)
        guiSetVisible(jobwindow,false)
        guiSetVisible(quitbutton,true)
        guiSetVisible(takebutton,false)
        guiSetVisible(offduty,true)
        guiSetVisible(onduty,false)
        guiSetVisible(cancbutton,true)
        showCursor(false)
        --
        offduty = guiCreateButton(10,378,166,54, "Quit of The Task", false, jobwindow)
        guiSetProperty(offduty, "NormalTextColour", "FFAAAAAA")
        setTimer(function()
guiSetProperty(offduty, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
    end, 100, 0)
       
       
        end
    end
end)
 
addEventHandler("onClientGUIClick",jobwindow,
function(b,thePlayer)
    if b == "left" then
        if source == offduty then
        guiSetVisible(jobwindow,false)
        guiSetVisible(quitbutton,true)
        guiSetVisible(takebutton,false)
        guiSetVisible(offduty,false)
        guiSetVisible(onduty,true)
        guiSetVisible(cancbutton,true)
        showCursor(false)
        destroyElement ( truckerMarker )
        destroyElement ( truckerBlip )
        end
    end
end)
       
addEventHandler("onClientMarkerHit",getjobmarker,
    function(p)
        if p == lp and not isPedInVehicle(lp) then
            guiSetVisible(jobwindow,true)
            showCursor(true)
        end
    end
)
 
addEvent("HaveTruckerJob", true)
function createDestinations ()
    x, y, z = unpackDestinations ()
    truckerMarker = createMarker ( x, y, z, "cylinder", 3, 255, 255, 255, 255, localPlayer )
    truckerBlip = createBlipAttachedTo ( truckerMarker, 51, localPlayer )
end
addEventHandler ( "HaveTruckerJob", root, createDestinations )
 
addEventHandler ( "onClientMarkerHit", root,
    function ( hitElement )
        if source == truckerMarker and localPlayer == hitElement  then
        local vehicle = getPedOccupiedVehicle ( localPlayer )
        if vehicle and getElementModel(vehicle) == 411 then
            triggerServerEvent ( "givePlayerPay", localPlayer )
            destroyElement ( truckerMarker )
 
            if isElement(truckerBlip) then
            destroyElement ( truckerBlip )
end
 
            guiSetVisible(destinationwindow,true)
            showCursor(true)
            triggerEvent ( "createTruckerEvent", localPlayer )
        end
    end
end)
 
addEventHandler ( "onClientPedDamage", resourceRoot,
    function ()
        cancelEvent ()
    end
)
 
 
   
addEventHandler("onClientGUIClick",destinationwindow,
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...