Jump to content

تصيح الكود


Recommended Posts

السلام عليكم ورحمة الله وبركاته

اين الخطأ هنا؟؟

يجيني البوتون + الليبل بوجهي عند تشغيل املود لكن اين الخطأ؟

local Marker = createMarker (114.19709,1341.90759,9.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
createwindow = guiCreateWindow(108, 53, 587, 443, "Create Weapon", false) 
guiWindowSetSizable(createwindow, false) 
guiSetAlpha(createwindow, 1.00) 
guiSetVisible(createwindow,false) 
tap1 = guiCreateTabPanel(9, 22, 569, 410, false, createwindow) 
  
tap1 = guiCreateTab("الذخيرة", tap1) 
  
b20 = guiCreateButton(10, 26, 105, 47, "صنع ذخيرة", false, tap1) 
guiSetProperty(b20, "NormalTextColour", "FFFEFFFE") 
label1 = guiCreateLabel(122, 30, 447, 43, "لاخذ 20 ذخيرة تحتاج 1 حديد,1نحاس,1بارود", false, tap1) 
guiSetFont(label1, "default-bold-small") 
b40 = guiCreateButton(10, 179, 105, 47, "صنع ذخيرة", false, tap1) 
guiSetProperty(b40, "NormalTextColour", "FFFEFFFE") 
label2 = guiCreateLabel(122, 179, 447, 43, "لاخذ 40 ذخيرة تحتاج 2 حديد,2نحاس2بارود", false, tap1) 
guiSetFont(label2, "default-bold-small") 
b60 = guiCreateButton(10, 320, 105, 47, "صنع ذخيرة", false, tap1) 
guiSetProperty(b60, "NormalTextColour", "FFFEFFFE") 
label3 = guiCreateLabel(122, 320, 447, 43, "لاخذ 60 ذخيرة تحتاج 3 حديد,3نحاس3بارود", false, tap1) 
guiSetFont(label3, "default-bold-small") 
  
tap2 = guiCreateTab("القنابل", tap1) 
  
bsbs = guiCreateButton(10, 24, 127, 53, "صنع القنبلة", false, tap2) 
guiSetProperty(bsbs, "NormalTextColour", "FFFEFFFE") 
label4 = guiCreateLabel(147, 29, 395, 48, "لصنع القنبلة تحتاج ل1حديد,1نحاس,1بارود", false, tap2) 
bb1 = guiCreateButton(0.02, 0.06, 0.22, 0.14, "صنع القنبلة", false, tap2) 
guiSetProperty(bb1, "NormalTextColour", "FFFEFFFE") 
bb2 = guiCreateButton(0.02, 0.42, 0.22, 0.14, "صنع القنبلة", false, tap2) 
guiSetProperty(bb2, "NormalTextColour", "FFFEFFFE") 
bb3 = guiCreateButton(0.02, 0.81, 0.22, 0.14, "صنع القنبلة", false, tap2) 
guiSetProperty(bb3, "NormalTextColour", "FFFEFFFE") 
label5 = guiCreateLabel(147, 164, 395, 48, "لصنع قنبلتان تحتاج ل2حديد,2نحاس,2بارود", false, tap2) 
label6 = guiCreateLabel(143, 312, 395, 48, "لصنع 3 قنابل تحتاج ل3حديد,3نحاس,3بارود", false, tap2) 
  
  
addEventHandler("onClientMarkerHit",marker5, 
 function() 
guiSetVisible(createwindow,true) 
showCursor(true) 
end) 
  
  
addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 1 then 
            if  (getElementData (localPlayer,"Copper") or 0)  >= 1 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 2 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 2 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 3 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 3 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

Link to comment
local Marker = createMarker (114.19709,1341.90759,9.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
createwindow = guiCreateWindow(108, 53, 587, 443, "Create Weapon", false) 
guiWindowSetSizable(createwindow, false) 
guiSetAlpha(createwindow, 1.00) 
guiSetVisible(createwindow,false) 
tap1 = guiCreateTabPanel(9, 22, 569, 410, false, createwindow) 
  
tap2 = guiCreateTab("الذخيرة", tap1) 
  
b20 = guiCreateButton(10, 26, 105, 47, "صنع ذخيرة", false, tap2) 
guiSetProperty(b20, "NormalTextColour", "FFFEFFFE") 
label1 = guiCreateLabel(122, 30, 447, 43, "لاخذ 20 ذخيرة تحتاج 1 حديد,1نحاس,1بارود", false, tap2) 
guiSetFont(label1, "default-bold-small") 
b40 = guiCreateButton(10, 179, 105, 47, "صنع ذخيرة", false, tap2) 
guiSetProperty(b40, "NormalTextColour", "FFFEFFFE") 
label2 = guiCreateLabel(122, 179, 447, 43, "لاخذ 40 ذخيرة تحتاج 2 حديد,2نحاس2بارود", false, tap2) 
guiSetFont(label2, "default-bold-small") 
b60 = guiCreateButton(10, 320, 105, 47, "صنع ذخيرة", false, tap2) 
guiSetProperty(b60, "NormalTextColour", "FFFEFFFE") 
label3 = guiCreateLabel(122, 320, 447, 43, "لاخذ 60 ذخيرة تحتاج 3 حديد,3نحاس3بارود", false, tap2) 
guiSetFont(label3, "default-bold-small") 
  
tap3 = guiCreateTab("القنابل", tap1) 
  
bsbs = guiCreateButton(10, 24, 127, 53, "صنع القنبلة", false, tap3) 
guiSetProperty(bsbs, "NormalTextColour", "FFFEFFFE") 
label4 = guiCreateLabel(147, 29, 395, 48, "لصنع القنبلة تحتاج ل1حديد,1نحاس,1بارود", false, tap3) 
bb1 = guiCreateButton(0.02, 0.06, 0.22, 0.14, "صنع القنبلة", false, tap3) 
guiSetProperty(bb1, "NormalTextColour", "FFFEFFFE") 
bb2 = guiCreateButton(0.02, 0.42, 0.22, 0.14, "صنع القنبلة", false, tap3) 
guiSetProperty(bb2, "NormalTextColour", "FFFEFFFE") 
bb3 = guiCreateButton(0.02, 0.81, 0.22, 0.14, "صنع القنبلة", false, tap3) 
guiSetProperty(bb3, "NormalTextColour", "FFFEFFFE") 
label5 = guiCreateLabel(147, 164, 395, 48, "لصنع قنبلتان تحتاج ل2حديد,2نحاس,2بارود", false, tap3) 
label6 = guiCreateLabel(143, 312, 395, 48, "لصنع 3 قنابل تحتاج ل3حديد,3نحاس,3بارود", false, tap3) 
  
  
addEventHandler("onClientMarkerHit",marker5, 
 function() 
guiSetVisible(createwindow,true) 
showCursor(true) 
end) 
  
  
addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 1 then 
            if  (getElementData (localPlayer,"Copper") or 0)  >= 1 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 2 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 2 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 3 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 3 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

جرب ^

Link to comment

السلام عليكم ورحمة الله وبركاته

عدلت اللوحة وصار خطأ هو عندما المس الماركر تفتح اللوحة وتغلق كل شيئ شغال

لكن عند الضغط على زر باللوحة ومعي الداتا ما اخد سلاح

الاكواد

--server 
local MinerStuff = { 
    "Iron", --: 
    "Copper", --: 
    "Gunpowder", --: 
  
} 
  
  
local minerW = { 31, 24, 27, 28, 34 } 
  
addEvent("TakeJobFashier",true) 
addEventHandler("TakeJobFashier",root, 
function (skin) 
    setElementModel(client,tonumber(skin)) 
    setElementData ( client,'Occupation','Miner-Jop' ) 
    triggerClientEvent(client,"createMinerMarkers",client) 
 end 
) 
  
  
  
  
  
  
addEvent("giveW",true) 
addEventHandler("giveW",root, 
function () 
    local Data = MinerStuff[math.random(#MinerStuff)] 
    if Data == "Iron" then 
        Reward = math.random( 1000 ) 
        elseif Data == "Sand" then 
        Reward = math.random( 5000 ) 
        elseif Data == "Yellow Sand" then 
        Reward = math.random( 3000 ) 
        elseif Data == "Dimond" then 
        Reward = math.random( 2 ) 
        elseif Data == "Uranuim" then 
        Reward = math.random( 4 ) 
        elseif Data == "Gold" then 
        Reward = math.random( 10 ) 
        elseif Data == "Silver" then 
        Reward = math.random( 30 ) 
        elseif Data == "Gunpowder" then 
        Reward = math.random( 20 ) 
        elseif Data == "Copper" then 
        Reward = math.random( 300 ) 
        elseif Data == "Baroud Ore" then 
        Reward = math.random ( 50 ) 
        elseif Data == "Pig Iron" then 
        Reward = math.random ( 500 ) 
        elseif Data == "Copper Ore" then 
        Reward = math.random ( 100 )     
        end 
    setElementData(source, Data,  (getElementData (source,Data) or 0) + Reward) 
    exports["guimessages"]:outputServer(source," Miner Jop : You Get "..Data.." #"..Reward ,255,0,0) 
end ) 
  
  
addEvent('remveMiner', true) 
addEventHandler('remveMiner', root, 
function ( ) 
    removeElementData(source,'Occupation') 
end 
) 
  
  
function playerLoginSavingData (thePreviousAccount, theCurrentAccount, autoLogin) 
    if (isGuestAccount (getPlayerAccount(source))) then return end 
        local T1 = getAccountData (theCurrentAccount, "Data") 
            setElementData(source,"Data",  T1 ) 
  end 
addEventHandler("onPlayerLogin", getRootElement(), playerLoginSavingData) 
  
function quitPlayerSavingData ( quitType ) 
    if (isGuestAccount (getPlayerAccount(source))) then return end           
        local T1 = getElementData (source, "Data")  
            setAccountData(getPlayerAccount(source),"Data", T1) 
end 
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayerSavingData ) 
  
  
addEvent("weaponRemove",true) 
addEventHandler("weaponRewmove",root, function() 
giveWeapon(source,24,20) 
giveWeapon(source,26,20) 
giveWeapon(source,27,20) 
giveWeapon(source,29,20) 
giveWeapon(source,31,20) 
giveWeapon(source,34,20) 
giveWeapon(source,39,20) 
giveWeapon(source,26,20) 
giveWeapon(source,25,20) 
setElementData(source, "Iron",  (getElementData (source,"Iron") or 0) - 1) 
setElementData(source, "Copper",  (getElementData (source,"Copper") or 0) - 1) 
setElementData(source, "Gunpowder",  (getElementData (source,"Gunpowder") or 0) - 1) 
end) 
  
  
  
addEvent("weaponRemove2",true) 
addEventHandler("weaponRewmove2",root, function() 
giveWeapon(source,24,40) 
giveWeapon(source,26,40) 
giveWeapon(source,27,40) 
giveWeapon(source,29,40) 
giveWeapon(source,31,40) 
giveWeapon(source,34,40) 
giveWeapon(source,39,40) 
giveWeapon(source,26,40) 
giveWeapon(source,25,40) 
setElementData(source, "Iron",  (getElementData (source,"Iron") or 0) - 2) 
setElementData(source, "Copper",  (getElementData (source,"Copper") or 0) - 2) 
setElementData(source, "Gunpowder",  (getElementData (source,"Gunpowder") or 0) - 2) 
end) 
  
  
  
addEvent("weaponRemove3",true) 
addEventHandler("weaponRewmove3",root, function() 
giveWeapon(source,24,60) 
giveWeapon(source,26,60) 
giveWeapon(source,27,60) 
giveWeapon(source,29,60) 
giveWeapon(source,31,60) 
giveWeapon(source,34,60) 
giveWeapon(source,39,60) 
giveWeapon(source,26,60) 
giveWeapon(source,25,60) 
setElementData(source, "Iron",  (getElementData (source,"Iron") or 0) - 3) 
setElementData(source, "Copper",  (getElementData (source,"Copper") or 0) - 3) 
setElementData(source, "Gunpowder",  (getElementData (source,"Gunpowder") or 0) - 3) 
end) 

--client 
local minerMarkers = {
{758.51599121094,753.36242675781,-4.0033869743347},
{740.45263671875,951.43524169922,-7.4548559188843},
{719.60821533203,970.32391357422,-7.4544372558594},
{627.25408935547,1008.5667114258,5.8102149963379},
{517.28771972656,1000.5893554688,-9.9594945907593},
{615.06231689453,774.80004882813,-32.110679626465},
{706.62518310547,792.21044921875,-30.262800216675},
{530.48461914063,916.84991455078,-42.655982971191},
{464.3349609375,865.015625,-27.464292526245},
{477.39825439453,807.1201171875,-18.829044342041},
{495.00930786133,778.30975341797,-21.634286880493},
{664.21527099609,719.94189453125,-3.996431350708},
{764.72650146484,827.23968505859,-7.4562559127808},
{740.41015625,951.22607421875,-7.4522466659546},
{687.07775878906,988.03552246094,-12.809737205505},
{696.51965332031,1005.3439941406,5.8082227706909},
{609.52349853516,985.73626708984,-7.4645547866821},
{534.44323730469,774.56799316406,-20.002136230469},
{510.88034057617,819.73706054688,-23.856391906738},
{491.29666137695,849.36956787109,-29.565511703491},
{537.17266845703,969.67395019531,-21.359622955322},
{498.93463134766,928.39727783203,-29.017789840698},
{483.15072631836,906.6708984375,-30.92096328735}
}
 
Taxi1 = createMarker(602.177734375,868.09375,-42.9609375,"cylinder",2,0,0,0,0)
skin1 = createPed(27,602.177734375,868.09375,-42.9609375,90)
blip = createBlip(602.177734375,868.09375,-42.9609375,56)
setBlipVisibleDistance(blip,400)
setElementFrozen(skin1,true)
addEventHandler("onClientPedDamage",root,
function ()
if source == skin1 then
    cancelEvent()
    end
end)
local x,y = guiGetScreenSize()
addEventHandler("onClientMarkerHit",root,
function (hit)
  if source == Taxi1 then
 if ( getElementData( hit, 'Occupation' ) ~= "Miner-Jop" )  and not isPedInVehicle(hit) then
  if localPlayer == hit then
   guiSetVisible(GUIEditor.window[1],true)
      showCursor(true)
 end
 end
 end
 end)
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
local x = x - 332
local y = y - 333
        GUIEditor.window[1] = guiCreateWindow(x/2,y/2,332,333, "[JopSystem]Iron Miner Jop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1],false)
        GUIEditor.button[1] = guiCreateButton(9, 272, 94, 41, "Take Job", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(233, 272, 89, 41, "Close", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        Memo1 = guiCreateMemo(13, 30, 318, 70, "الذهاب الي الصخور وقم بالضغط علي زر تاب وسيتم \nتكسيرها والحصول على النقود\n \nGo To The Rocks, And Press Tab to\nStart Breaking it and Get Money.", false, GUIEditor.window[1])
        guiMemoSetReadOnly(Memo1, true)    
        GUIEditor.gridlist[1] = guiCreateGridList(12, 120, 310, 140, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Number", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 0.3)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[1])
        end
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "Miner 1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "2", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "260", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 3, "Miner 2", false, false)
addEventHandler("onClientGUIClick",root,
function ()
  if source == GUIEditor.button[1] then
   local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2)
     if skin ~= "" then
     
      triggerServerEvent("TakeJobFashier",localPlayer,skin)
      guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
    end
  elseif source == GUIEditor.button[2] then
  guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
  end
 end)
addEventHandler("onClientRender", getRootElement(),
function()
                local x, y, z = getElementPosition(skin1)
                local x2, y2, z2 = getElementPosition(localPlayer)
                if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then
                    local sx, sy = getScreenFromWorldPosition(x, y, z+1.3)
                    if(sx) and (sy) then
                        local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
                        if(distance < 30) then
                            dxDrawText("Miner Job", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center")
                            dxDrawText("Miner Job", sx, sy, sx, sy, tocolor(255,255,0), 2-(distance/20), "arial", "center", "center")
            end
        end
    end
end)
 
addEvent("createMinerMarkers",true)
addEventHandler("createMinerMarkers",root,
function ()
local num = math.random (#minerMarkers)
local x = minerMarkers [num][1]
local y = minerMarkers [num][2]
local z = minerMarkers [num][3]
minerMark = createMarker(x,y,z,"cylinder",2.0,0,0,0,0)
minerMarkk = createMarker(x,y,z+2.0,"arrow",1.0,255,0,0,255)
minerObj = createObject(3931,x,y,z)
minerBlip = createBlip(x,y,z,41)
end
)
 
local x,y = guiGetScreenSize()
local x = x - 355
local y = y - -356
        window = guiCreateWindow(x/2, y/2, 403, 82, "[JopSystem]Iron Miner", false)
        guiWindowSetSizable(window, false)
        guiSetVisible(window,false)
        progressbar = guiCreateProgressBar(14, 31, 372, 36, false, window)
        label = guiCreateLabel(172, 10, 329, 15, "0%", false, progressbar)
        guiLabelSetColor(label, 1, 0, 0)
 
function startJob()
    if ( guiGetVisible ( window ) == true) then return end
    setElementFrozen(localPlayer,true)
    setPedAnimation(localPlayer,"BSKTBALL","BBALL_react_miss")
    setTimer(setPedAnimation,10000,1,localPlayer,localPlayer)
    setTimer(setElementFrozen,10000,1,localPlayer,false)
    showCursor(true)
    guiSetVisible(window,true)
    local lol = guiProgressBarGetProgress(progressbar)
    setTimer( guiProgressBarSetProgress, 1000, 1,progressbar,lol+10 )
    setTimer( guiSetText, 1000, 1,label,"10%")
    setTimer( guiProgressBarSetProgress, 2000, 1,progressbar,lol+20 )
    setTimer( guiSetText, 2000, 1,label,"20%")
    setTimer( guiProgressBarSetProgress, 3000, 1,progressbar,lol+30 )
    setTimer( guiSetText, 3000, 1,label,"30%")
    setTimer( guiProgressBarSetProgress, 4000, 1,progressbar,lol+40 )
    setTimer( guiSetText, 4000, 1,label,"40%")
    setTimer( guiProgressBarSetProgress, 5000, 1,progressbar,lol+50 )
    setTimer( guiSetText, 5000, 1,label,"50%")
    setTimer( guiProgressBarSetProgress, 6000, 1,progressbar,lol+60 )
    setTimer( guiSetText, 6000, 1,label,"60%")
    setTimer( guiProgressBarSetProgress, 7000, 1,progressbar,lol+70 )
    setTimer( guiSetText, 7000, 1,label,"70%")
    setTimer( guiProgressBarSetProgress, 8000, 1,progressbar,lol+80 )
    setTimer( guiSetText, 8000, 1,label,"80%")
    setTimer( guiProgressBarSetProgress, 9000, 1,progressbar,lol+90 )
    setTimer( guiSetText, 9000, 1,label,"90%")
    setTimer( guiProgressBarSetProgress, 10000, 1,progressbar,lol+100 )
    setTimer( guiSetText, 10000, 1,label,"100%")
    timer = setTimer(function ()    
              guiSetVisible(window, false)
              showCursor(false)
              guiProgressBarSetProgress(progressbar, 0)
              unbindKey("tab","down",startN9)
              local num = math.random (#minerMarkers)
              local x = minerMarkers [num][1]
              local y = minerMarkers [num][2]
              local z = minerMarkers [num][3]
              setElementPosition(minerMark,x,y,z)
              setElementPosition(minerMarkk,x,y,z+2.0)
              setElementPosition(minerBlip,x,y,z)
              setElementPosition(minerObj,x,y,z)
              triggerServerEvent("giveW",localPlayer)
end,
10000,1)
end
 
 
addEventHandler("onClientMarkerHit",root,
function (hitting)
if source == minerMark then
if ( getElementData( hitting, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( hitting ) ) == "No Team" ) and not isPedInVehicle(hitting) then
bindKey("H","down",startJob)
end
end
end
)
 
addEventHandler("onClientMarkerLeave",root,
function ()
unbindKey("H","down",startJob)
end
)
 
fileDelete('jobClient.lua')
 
 
 
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        window22 = guiCreateWindow(451, 305, 264, 131, "[JopSystem]Iron Jop : Warring !!", false)
        guiWindowSetSizable(window22, false)
        guiSetAlpha(window22 , 1.00)
        guiSetProperty(window22, "CaptionColour", "FFFE0000")
        guiSetVisible (window22, false)
 
        label22 = guiCreateLabel(20, 23, 241, 31, "Are You Sure Want To Get Out Of The Job", false, window22)
        guiSetFont(label22, "default-bold-small")
        guiLabelSetColor(label22, 254, 0, 255)
        button11 = guiCreateButton(10, 64, 110, 54, "Yes", false, window22)
        button22 = guiCreateButton(143, 64, 110, 54, "No", false, window22)
end    
)
 
 
 
addEventHandler("onClientMarkerHit",root,
function ( hitElement )
    if ( source == Taxi1 ) then
                if ( hitElement == localPlayer ) then
                if ( getPlayerTeam ( localPlayer ) ) then
                if ( getElementData( localPlayer, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( localPlayer ) ) == "No Team" ) and not isPedInVehicle(localPlayer) then
                guiSetVisible (window22, true)
                showCursor(true)
            end
          end
       end
     end
end
)
 
 
 
addEventHandler( "onClientGUIClick", root,
function()
if source ==  button11 then
triggerServerEvent('remveMiner', localPlayer)
guiSetVisible (window22, false)
showCursor (false)
destroyElement ( minerMark )
destroyElement ( minerMarkk )
destroyElement ( minerBlip )
destroyElement ( minerObj )
elseif source ==  button22 then
guiSetVisible (window22, false)
showCursor (false)
end
Link to comment
ما حددت المطلوب اخي

ان ضغط على زر يتحقق اذا معك 1 من كل داتا انا محددها

ويعطيه 20 رصاصة من الاسلحة التي احددها

لكن ما يعطي شي

فيه 3 ترايقرات وكلها تعطي اسلحة

ممكن تحدد اي ترايقر يعطي اسلحة ؟

+

source جرب تحط بدل

client

Link to comment
ما حددت المطلوب اخي

ان ضغط على زر يتحقق اذا معك 1 من كل داتا انا محددها

ويعطيه 20 رصاصة من الاسلحة التي احددها

لكن ما يعطي شي

فيه 3 ترايقرات وكلها تعطي اسلحة

ممكن تحدد اي ترايقر يعطي اسلحة ؟

+

source جرب تحط بدل

client

الترايقر الاول ان ضغط على الزر الاول والتاني ان ضغط على التاني والتالت ان ضغط على التالت

وكلها تعطي اسلحة لكن حسب البوتون الذي ضغط عليه يجيه عدد الرصاص

Link to comment

الاكواد كاملة

كلينت

local minerMarkers = {  
{758.51599121094,753.36242675781,-4.0033869743347},
{740.45263671875,951.43524169922,-7.4548559188843},
{719.60821533203,970.32391357422,-7.4544372558594},
{627.25408935547,1008.5667114258,5.8102149963379},
{517.28771972656,1000.5893554688,-9.9594945907593},
{615.06231689453,774.80004882813,-32.110679626465},
{706.62518310547,792.21044921875,-30.262800216675},
{530.48461914063,916.84991455078,-42.655982971191},
{464.3349609375,865.015625,-27.464292526245},
{477.39825439453,807.1201171875,-18.829044342041},
{495.00930786133,778.30975341797,-21.634286880493},
{664.21527099609,719.94189453125,-3.996431350708},
{764.72650146484,827.23968505859,-7.4562559127808},
{740.41015625,951.22607421875,-7.4522466659546},
{687.07775878906,988.03552246094,-12.809737205505},
{696.51965332031,1005.3439941406,5.8082227706909},
{609.52349853516,985.73626708984,-7.4645547866821},
{534.44323730469,774.56799316406,-20.002136230469},
{510.88034057617,819.73706054688,-23.856391906738},
{491.29666137695,849.36956787109,-29.565511703491},
{537.17266845703,969.67395019531,-21.359622955322},
{498.93463134766,928.39727783203,-29.017789840698},
{483.15072631836,906.6708984375,-30.92096328735}
}
 
Taxi1 = createMarker(602.177734375,868.09375,-42.9609375,"cylinder",2,0,0,0,0)
skin1 = createPed(27,602.177734375,868.09375,-42.9609375,90)
blip = createBlip(602.177734375,868.09375,-42.9609375,56)
setBlipVisibleDistance(blip,400)
setElementFrozen(skin1,true)
addEventHandler("onClientPedDamage",root,
function ()
if source == skin1 then
    cancelEvent()
    end
end)
local x,y = guiGetScreenSize()
addEventHandler("onClientMarkerHit",root,
function (hit)
  if source == Taxi1 then
 if ( getElementData( hit, 'Occupation' ) ~= "Miner-Jop" )  and not isPedInVehicle(hit) then
  if localPlayer == hit then
   guiSetVisible(GUIEditor.window[1],true)
      showCursor(true)
 end
 end
 end
 end)
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
local x = x - 332
local y = y - 333
        GUIEditor.window[1] = guiCreateWindow(x/2,y/2,332,333, "[JopSystem]Iron Miner Jop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1],false)
        GUIEditor.button[1] = guiCreateButton(9, 272, 94, 41, "Take Job", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(233, 272, 89, 41, "Close", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        Memo1 = guiCreateMemo(13, 30, 318, 70, "الذهاب الي الصخور وقم بالضغط علي زر تاب وسيتم \nتكسيرها والحصول على النقود\n \nGo To The Rocks, And Press Tab to\nStart Breaking it and Get Money.", false, GUIEditor.window[1])
        guiMemoSetReadOnly(Memo1, true)    
        GUIEditor.gridlist[1] = guiCreateGridList(12, 120, 310, 140, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Number", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 0.3)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[1])
        end
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "Miner 1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "2", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "260", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 3, "Miner 2", false, false)
addEventHandler("onClientGUIClick",root,
function ()
  if source == GUIEditor.button[1] then
   local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2)
     if skin ~= "" then
     
      triggerServerEvent("TakeJobFashier",localPlayer,skin)
      guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
    end
  elseif source == GUIEditor.button[2] then
  guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
  end
 end)
addEventHandler("onClientRender", getRootElement(),
function()
                local x, y, z = getElementPosition(skin1)
                local x2, y2, z2 = getElementPosition(localPlayer)
                if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then
                    local sx, sy = getScreenFromWorldPosition(x, y, z+1.3)
                    if(sx) and (sy) then
                        local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
                        if(distance < 30) then
                            dxDrawText("Miner Job", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center")
                            dxDrawText("Miner Job", sx, sy, sx, sy, tocolor(255,255,0), 2-(distance/20), "arial", "center", "center")
            end
        end
    end
end)
 
addEvent("createMinerMarkers",true)
addEventHandler("createMinerMarkers",root,
function ()
local num = math.random (#minerMarkers)
local x = minerMarkers [num][1]
local y = minerMarkers [num][2]
local z = minerMarkers [num][3]
minerMark = createMarker(x,y,z,"cylinder",2.0,0,0,0,0)
minerMarkk = createMarker(x,y,z+2.0,"arrow",1.0,255,0,0,255)
minerObj = createObject(3931,x,y,z)
minerBlip = createBlip(x,y,z,41)
end
)
 
local x,y = guiGetScreenSize()
local x = x - 355
local y = y - -356
        window = guiCreateWindow(x/2, y/2, 403, 82, "[JopSystem]Iron Miner", false)
        guiWindowSetSizable(window, false)
        guiSetVisible(window,false)
        progressbar = guiCreateProgressBar(14, 31, 372, 36, false, window)
        label = guiCreateLabel(172, 10, 329, 15, "0%", false, progressbar)
        guiLabelSetColor(label, 1, 0, 0)
 
function startJob()
    if ( guiGetVisible ( window ) == true) then return end
    setElementFrozen(localPlayer,true)
    setPedAnimation(localPlayer,"BSKTBALL","BBALL_react_miss")
    setTimer(setPedAnimation,10000,1,localPlayer)
    setTimer(setElementFrozen,10000,1,localPlayer,false)
    showCursor(true)
    guiSetVisible(window,true)
    local lol = guiProgressBarGetProgress(progressbar)
    setTimer( guiProgressBarSetProgress, 1000, 1,progressbar,lol+10 )
    setTimer( guiSetText, 1000, 1,label,"10%")
    setTimer( guiProgressBarSetProgress, 2000, 1,progressbar,lol+20 )
    setTimer( guiSetText, 2000, 1,label,"20%")
    setTimer( guiProgressBarSetProgress, 3000, 1,progressbar,lol+30 )
    setTimer( guiSetText, 3000, 1,label,"30%")
    setTimer( guiProgressBarSetProgress, 4000, 1,progressbar,lol+40 )
    setTimer( guiSetText, 4000, 1,label,"40%")
    setTimer( guiProgressBarSetProgress, 5000, 1,progressbar,lol+50 )
    setTimer( guiSetText, 5000, 1,label,"50%")
    setTimer( guiProgressBarSetProgress, 6000, 1,progressbar,lol+60 )
    setTimer( guiSetText, 6000, 1,label,"60%")
    setTimer( guiProgressBarSetProgress, 7000, 1,progressbar,lol+70 )
    setTimer( guiSetText, 7000, 1,label,"70%")
    setTimer( guiProgressBarSetProgress, 8000, 1,progressbar,lol+80 )
    setTimer( guiSetText, 8000, 1,label,"80%")
    setTimer( guiProgressBarSetProgress, 9000, 1,progressbar,lol+90 )
    setTimer( guiSetText, 9000, 1,label,"90%")
    setTimer( guiProgressBarSetProgress, 10000, 1,progressbar,lol+100 )
    setTimer( guiSetText, 10000, 1,label,"100%")
    timer = setTimer(function ()    
              guiSetVisible(window, false)
              showCursor(false)
              guiProgressBarSetProgress(progressbar, 0)
              unbindKey("tab","down",startN9)
              local num = math.random (#minerMarkers)
              local x = minerMarkers [num][1]
              local y = minerMarkers [num][2]
              local z = minerMarkers [num][3]
              setElementPosition(minerMark,x,y,z)
              setElementPosition(minerMarkk,x,y,z+2.0)
              setElementPosition(minerBlip,x,y,z)
              setElementPosition(minerObj,x,y,z)
              triggerServerEvent("giveW",localPlayer)
end,
10000,1)
end
 
 
addEventHandler("onClientMarkerHit",root,
function (hitting)
if source == minerMark then
if ( getElementData( hitting, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( hitting ) ) == "No Team" ) and not isPedInVehicle(hitting) then
bindKey("H","down",startJob)
end
end
end
)
 
addEventHandler("onClientMarkerLeave",root,
function ()
unbindKey("H","down",startJob)
end
)
 
fileDelete('jobClient.lua')
 
 
 
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        window22 = guiCreateWindow(451, 305, 264, 131, "[JopSystem]Iron Jop : Warring !!", false)
        guiWindowSetSizable(window22, false)
        guiSetAlpha(window22 , 1.00)
        guiSetProperty(window22, "CaptionColour", "FFFE0000")
        guiSetVisible (window22, false)
 
        label22 = guiCreateLabel(20, 23, 241, 31, "Are You Sure Want To Get Out Of The Job", false, window22)
        guiSetFont(label22, "default-bold-small")
        guiLabelSetColor(label22, 254, 0, 255)
        button11 = guiCreateButton(10, 64, 110, 54, "Yes", false, window22)
        button22 = guiCreateButton(143, 64, 110, 54, "No", false, window22)
end    
)
 
 
 
addEventHandler("onClientMarkerHit",root,
function ( hitElement )
    if ( source == Taxi1 ) then
                if ( hitElement == localPlayer ) then
                if ( getPlayerTeam ( localPlayer ) ) then
                if ( getElementData( localPlayer, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( localPlayer ) ) == "No Team" ) and not isPedInVehicle(localPlayer) then
                guiSetVisible (window22, true)
                showCursor(true)
            end
          end
       end
     end
end
)
 
 
 
addEventHandler( "onClientGUIClick", root,
function()
if source ==  button11 then
triggerServerEvent('remveMiner', localPlayer)
guiSetVisible (window22, false)
showCursor (false)
destroyElement ( minerMark )
destroyElement ( minerMarkk )
destroyElement ( minerBlip )
destroyElement ( minerObj )
elseif source ==  button22 then
guiSetVisible (window22, false)
showCursor (false)
end
end
Link to comment

شف استبدلله باللي عندك ..

جرب اضغط ع زر b20

اللي هو صنع ذخيرة 20

اذا اشتغل معناته انه الداتا فيها مشكلة ي اما ما تطابق التحقق يعني مافي حديد مدري نحاس .. برب .

local minerMarkers = { 
{758.51599121094,753.36242675781,-4.0033869743347},
{740.45263671875,951.43524169922,-7.4548559188843},
{719.60821533203,970.32391357422,-7.4544372558594},
{627.25408935547,1008.5667114258,5.8102149963379},
{517.28771972656,1000.5893554688,-9.9594945907593},
{615.06231689453,774.80004882813,-32.110679626465},
{706.62518310547,792.21044921875,-30.262800216675},
{530.48461914063,916.84991455078,-42.655982971191},
{464.3349609375,865.015625,-27.464292526245},
{477.39825439453,807.1201171875,-18.829044342041},
{495.00930786133,778.30975341797,-21.634286880493},
{664.21527099609,719.94189453125,-3.996431350708},
{764.72650146484,827.23968505859,-7.4562559127808},
{740.41015625,951.22607421875,-7.4522466659546},
{687.07775878906,988.03552246094,-12.809737205505},
{696.51965332031,1005.3439941406,5.8082227706909},
{609.52349853516,985.73626708984,-7.4645547866821},
{534.44323730469,774.56799316406,-20.002136230469},
{510.88034057617,819.73706054688,-23.856391906738},
{491.29666137695,849.36956787109,-29.565511703491},
{537.17266845703,969.67395019531,-21.359622955322},
{498.93463134766,928.39727783203,-29.017789840698},
{483.15072631836,906.6708984375,-30.92096328735}
}
 
Taxi1 = createMarker(602.177734375,868.09375,-42.9609375,"cylinder",2,0,0,0,0)
skin1 = createPed(27,602.177734375,868.09375,-42.9609375,90)
blip = createBlip(602.177734375,868.09375,-42.9609375,56)
setBlipVisibleDistance(blip,400)
setElementFrozen(skin1,true)
addEventHandler("onClientPedDamage",root,
function ()
if source == skin1 then
    cancelEvent()
    end
end)
local x,y = guiGetScreenSize()
addEventHandler("onClientMarkerHit",root,
function (hit)
  if source == Taxi1 then
 if ( getElementData( hit, 'Occupation' ) ~= "Miner-Jop" )  and not isPedInVehicle(hit) then
  if localPlayer == hit then
   guiSetVisible(GUIEditor.window[1],true)
      showCursor(true)
 end
 end
 end
 end)
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
local x = x - 332
local y = y - 333
        GUIEditor.window[1] = guiCreateWindow(x/2,y/2,332,333, "[JopSystem]Iron Miner Jop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1],false)
        GUIEditor.button[1] = guiCreateButton(9, 272, 94, 41, "Take Job", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(233, 272, 89, 41, "Close", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        Memo1 = guiCreateMemo(13, 30, 318, 70, "الذهاب الي الصخور وقم بالضغط علي زر تاب وسيتم \nتكسيرها والحصول على النقود\n \nGo To The Rocks, And Press Tab to\nStart Breaking it and Get Money.", false, GUIEditor.window[1])
        guiMemoSetReadOnly(Memo1, true)    
        GUIEditor.gridlist[1] = guiCreateGridList(12, 120, 310, 140, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Number", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 0.3)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[1])
        end
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "Miner 1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "2", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "260", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 3, "Miner 2", false, false)
addEventHandler("onClientGUIClick",root,
function ()
  if source == GUIEditor.button[1] then
   local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2)
     if skin ~= "" then
     
      triggerServerEvent("TakeJobFashier",localPlayer,skin)
      guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
    end
  elseif source == GUIEditor.button[2] then
  guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
  end
 end)
addEventHandler("onClientRender", getRootElement(),
function()
                local x, y, z = getElementPosition(skin1)
                local x2, y2, z2 = getElementPosition(localPlayer)
                if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then
                    local sx, sy = getScreenFromWorldPosition(x, y, z+1.3)
                    if(sx) and (sy) then
                        local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
                        if(distance < 30) then
                            dxDrawText("Miner Job", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center")
                            dxDrawText("Miner Job", sx, sy, sx, sy, tocolor(255,255,0), 2-(distance/20), "arial", "center", "center")
            end
        end
    end
end)
 
addEvent("createMinerMarkers",true)
addEventHandler("createMinerMarkers",root,
function ()
local num = math.random (#minerMarkers)
local x = minerMarkers [num][1]
local y = minerMarkers [num][2]
local z = minerMarkers [num][3]
minerMark = createMarker(x,y,z,"cylinder",2.0,0,0,0,0)
minerMarkk = createMarker(x,y,z+2.0,"arrow",1.0,255,0,0,255)
minerObj = createObject(3931,x,y,z)
minerBlip = createBlip(x,y,z,41)
end
)
 
local x,y = guiGetScreenSize()
local x = x - 355
local y = y - -356
        window = guiCreateWindow(x/2, y/2, 403, 82, "[JopSystem]Iron Miner", false)
        guiWindowSetSizable(window, false)
        guiSetVisible(window,false)
        progressbar = guiCreateProgressBar(14, 31, 372, 36, false, window)
        label = guiCreateLabel(172, 10, 329, 15, "0%", false, progressbar)
        guiLabelSetColor(label, 1, 0, 0)
 
function startJob()
    if ( guiGetVisible ( window ) == true) then return end
    setElementFrozen(localPlayer,true)
    setPedAnimation(localPlayer,"BSKTBALL","BBALL_react_miss")
    setTimer(setPedAnimation,10000,1,localPlayer)
    setTimer(setElementFrozen,10000,1,localPlayer,false)
    showCursor(true)
    guiSetVisible(window,true)
    local lol = guiProgressBarGetProgress(progressbar)
    setTimer( guiProgressBarSetProgress, 1000, 1,progressbar,lol+10 )
    setTimer( guiSetText, 1000, 1,label,"10%")
    setTimer( guiProgressBarSetProgress, 2000, 1,progressbar,lol+20 )
    setTimer( guiSetText, 2000, 1,label,"20%")
    setTimer( guiProgressBarSetProgress, 3000, 1,progressbar,lol+30 )
    setTimer( guiSetText, 3000, 1,label,"30%")
    setTimer( guiProgressBarSetProgress, 4000, 1,progressbar,lol+40 )
    setTimer( guiSetText, 4000, 1,label,"40%")
    setTimer( guiProgressBarSetProgress, 5000, 1,progressbar,lol+50 )
    setTimer( guiSetText, 5000, 1,label,"50%")
    setTimer( guiProgressBarSetProgress, 6000, 1,progressbar,lol+60 )
    setTimer( guiSetText, 6000, 1,label,"60%")
    setTimer( guiProgressBarSetProgress, 7000, 1,progressbar,lol+70 )
    setTimer( guiSetText, 7000, 1,label,"70%")
    setTimer( guiProgressBarSetProgress, 8000, 1,progressbar,lol+80 )
    setTimer( guiSetText, 8000, 1,label,"80%")
    setTimer( guiProgressBarSetProgress, 9000, 1,progressbar,lol+90 )
    setTimer( guiSetText, 9000, 1,label,"90%")
    setTimer( guiProgressBarSetProgress, 10000, 1,progressbar,lol+100 )
    setTimer( guiSetText, 10000, 1,label,"100%")
    timer = setTimer(function ()    
              guiSetVisible(window, false)
              showCursor(false)
              guiProgressBarSetProgress(progressbar, 0)
              unbindKey("tab","down",startN9)
              local num = math.random (#minerMarkers)
              local x = minerMarkers [num][1]
              local y = minerMarkers [num][2]
              local z = minerMarkers [num][3]
              setElementPosition(minerMark,x,y,z)
              setElementPosition(minerMarkk,x,y,z+2.0)
              setElementPosition(minerBlip,x,y,z)
              setElementPosition(minerObj,x,y,z)
              triggerServerEvent("giveW",localPlayer)
end,
10000,1)
end
 
 
addEventHandler("onClientMarkerHit",root,
function (hitting)
if source == minerMark then
if ( getElementData( hitting, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( hitting ) ) == "No Team" ) and not isPedInVehicle(hitting) then
bindKey("H","down",startJob)
end
end
end
)
 
addEventHandler("onClientMarkerLeave",root,
function ()
unbindKey("H","down",startJob)
end
)
 
fileDelete('jobClient.lua')
 
 
 
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        window22 = guiCreateWindow(451, 305, 264, 131, "[JopSystem]Iron Jop : Warring !!", false)
        guiWindowSetSizable(window22, false)
        guiSetAlpha(window22 , 1.00)
        guiSetProperty(window22, "CaptionColour", "FFFE0000")
        guiSetVisible (window22, false)
 
        label22 = guiCreateLabel(20, 23, 241, 31, "Are You Sure Want To Get Out Of The Job", false, window22)
        guiSetFont(label22, "default-bold-small")
        guiLabelSetColor(label22, 254, 0, 255)
        button11 = guiCreateButton(10, 64, 110, 54, "Yes", false, window22)
        button22 = guiCreateButton(143, 64, 110, 54, "No", false, window22)
end    
)
 
 
 
addEventHandler("onClientMarkerHit",root,
function ( hitElement )
    if ( source == Taxi1 ) then
                if ( hitElement == localPlayer ) then
                if ( getPlayerTeam ( localPlayer ) ) then
                if ( getElementData( localPlayer, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( localPlayer ) ) == "No Team" ) and not isPedInVehicle(localPlayer) then
                guiSetVisible (window22, true)
                showCursor(true)
            end
          end
       end
     end
end
)
 
 
 
addEventHandler( "onClientGUIClick", root,
function()
if source ==  button11 then
triggerServerEvent('remveMiner', localPlayer)
guiSetVisible (window22, false)
showCursor (false)
destroyElement ( minerMark )
destroyElement ( minerMarkk )
destroyElement ( minerBlip )
destroyElement ( minerObj )
elseif source ==  button22 then
guiSetVisible (window22, false)
showCursor (false)
end
end
Link to comment

الحل بسيط

الكود الخطأ هنا

addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 1 then 
            if  (getElementData (localPlayer,"Copper") or 0)  >= 1 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 2 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 2 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 3 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 3 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

تصحيح الخطأ هنا

addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 1 then 
            if  tonumber (Copper)  >= 1 then 
                if  tonumber (Gunpowder) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 2 then 
            if  tonumber (Copper)  >= 2 then 
                if  tonumber (Gunpowder) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 3 then 
            if  tonumber (Copper)  >= 3 then 
                if  tonumber (Gunpowder) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

Link to comment
الحل بسيط

الكود الخطأ هنا

addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 1 then 
            if  (getElementData (localPlayer,"Copper") or 0)  >= 1 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 2 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 2 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
        if  (getElementData (localPlayer,"Iron") or 0) >= 3 then 
            if  (getElementData (localPlayer,"Copper") or 0) >= 3 then 
                if  (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

تصحيح الخطأ هنا

addEventHandler("onClientGUIClick",root, 
function() 
    if ( source == b20) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 1 then 
            if  tonumber (Copper)  >= 1 then 
                if  tonumber (Gunpowder) >= 1 then 
                    triggerServerEvent ("weaponRemove",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b40) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 2 then 
            if  tonumber (Copper)  >= 2 then 
                if  tonumber (Gunpowder) >= 2 then 
                    triggerServerEvent ("weaponRemove2",localPlayer) 
                end 
            end 
        end 
    elseif ( source == b60) then 
    local Iron = getElementData (localPlayer,"Iron") or 0 
    local Copper = getElementData (localPlayer,"Copper") or 0 
    local Gunpowder = getElementData (localPlayer,"Gunpowder") or 0 
        if  tonumber (Iron) >= 3 then 
            if  tonumber (Copper)  >= 3 then 
                if  tonumber (Gunpowder) >= 3 then 
                    triggerServerEvent ("weaponRemove3",localPlayer) 
                end 
            end 
        end 
    end 
end) 

شكراً لك بروح اجربها :)

Link to comment

خخخ

والله الحل كان بسيط بس يبيله تركيز

المشكلة ي طويل العمر

اسماء الترايقرات جايب في امها العيد في الكلينت شكل وبالسيرفر شكل

المهم تفضل

كلينت

local minerMarkers = { 
{758.51599121094,753.36242675781,-4.0033869743347},
{740.45263671875,951.43524169922,-7.4548559188843},
{719.60821533203,970.32391357422,-7.4544372558594},
{627.25408935547,1008.5667114258,5.8102149963379},
{517.28771972656,1000.5893554688,-9.9594945907593},
{615.06231689453,774.80004882813,-32.110679626465},
{706.62518310547,792.21044921875,-30.262800216675},
{530.48461914063,916.84991455078,-42.655982971191},
{464.3349609375,865.015625,-27.464292526245},
{477.39825439453,807.1201171875,-18.829044342041},
{495.00930786133,778.30975341797,-21.634286880493},
{664.21527099609,719.94189453125,-3.996431350708},
{764.72650146484,827.23968505859,-7.4562559127808},
{740.41015625,951.22607421875,-7.4522466659546},
{687.07775878906,988.03552246094,-12.809737205505},
{696.51965332031,1005.3439941406,5.8082227706909},
{609.52349853516,985.73626708984,-7.4645547866821},
{534.44323730469,774.56799316406,-20.002136230469},
{510.88034057617,819.73706054688,-23.856391906738},
{491.29666137695,849.36956787109,-29.565511703491},
{537.17266845703,969.67395019531,-21.359622955322},
{498.93463134766,928.39727783203,-29.017789840698},
{483.15072631836,906.6708984375,-30.92096328735}
}
 
Taxi1 = createMarker(602.177734375,868.09375,-42.9609375,"cylinder",2,0,0,0,0)
skin1 = createPed(27,602.177734375,868.09375,-42.9609375,90)
blip = createBlip(602.177734375,868.09375,-42.9609375,56)
setBlipVisibleDistance(blip,400)
setElementFrozen(skin1,true)
addEventHandler("onClientPedDamage",root,
function ()
if source == skin1 then
    cancelEvent()
    end
end)
local x,y = guiGetScreenSize()
addEventHandler("onClientMarkerHit",root,
function (hit)
  if source == Taxi1 then
 if ( getElementData( hit, 'Occupation' ) ~= "Miner-Jop" )  and not isPedInVehicle(hit) then
  if localPlayer == hit then
   guiSetVisible(GUIEditor.window[1],true)
      showCursor(true)
 end
 end
 end
 end)
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
local x = x - 332
local y = y - 333
        GUIEditor.window[1] = guiCreateWindow(x/2,y/2,332,333, "[JopSystem]Iron Miner Jop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1],false)
        GUIEditor.button[1] = guiCreateButton(9, 272, 94, 41, "Take Job", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(233, 272, 89, 41, "Close", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        Memo1 = guiCreateMemo(13, 30, 318, 70, "الذهاب الي الصخور وقم بالضغط علي زر تاب وسيتم \nتكسيرها والحصول على النقود\n \nGo To The Rocks, And Press Tab to\nStart Breaking it and Get Money.", false, GUIEditor.window[1])
        guiMemoSetReadOnly(Memo1, true)    
        GUIEditor.gridlist[1] = guiCreateGridList(12, 120, 310, 140, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Number", 0.3)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 0.3)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[1])
        end
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "Miner 1", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "2", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "260", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 3, "Miner 2", false, false)
addEventHandler("onClientGUIClick",root,
function ()
  if source == GUIEditor.button[1] then
   local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2)
     if skin ~= "" then
     
      triggerServerEvent("TakeJobFashier",localPlayer,skin)
      guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
    end
  elseif source == GUIEditor.button[2] then
  guiSetVisible(GUIEditor.window[1],false)
      showCursor(false)
  end
 end)
addEventHandler("onClientRender", getRootElement(),
function()
                local x, y, z = getElementPosition(skin1)
                local x2, y2, z2 = getElementPosition(localPlayer)
                if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then
                    local sx, sy = getScreenFromWorldPosition(x, y, z+1.3)
                    if(sx) and (sy) then
                        local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
                        if(distance < 30) then
                            dxDrawText("Miner Job", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center")
                            dxDrawText("Miner Job", sx, sy, sx, sy, tocolor(255,255,0), 2-(distance/20), "arial", "center", "center")
            end
        end
    end
end)
 
addEvent("createMinerMarkers",true)
addEventHandler("createMinerMarkers",root,
function ()
local num = math.random (#minerMarkers)
local x = minerMarkers [num][1]
local y = minerMarkers [num][2]
local z = minerMarkers [num][3]
minerMark = createMarker(x,y,z,"cylinder",2.0,0,0,0,0)
minerMarkk = createMarker(x,y,z+2.0,"arrow",1.0,255,0,0,255)
minerObj = createObject(3931,x,y,z)
minerBlip = createBlip(x,y,z,41)
end
)
 
local x,y = guiGetScreenSize()
local x = x - 355
local y = y - -356
        window = guiCreateWindow(x/2, y/2, 403, 82, "[JopSystem]Iron Miner", false)
        guiWindowSetSizable(window, false)
        guiSetVisible(window,false)
        progressbar = guiCreateProgressBar(14, 31, 372, 36, false, window)
        label = guiCreateLabel(172, 10, 329, 15, "0%", false, progressbar)
        guiLabelSetColor(label, 1, 0, 0)
 
function startJob()
    if ( guiGetVisible ( window ) == true) then return end
    setElementFrozen(localPlayer,true)
    setPedAnimation(localPlayer,"BSKTBALL","BBALL_react_miss")
    setTimer(setPedAnimation,10000,1,localPlayer)
    setTimer(setElementFrozen,10000,1,localPlayer,false)
    showCursor(true)
    guiSetVisible(window,true)
    local lol = guiProgressBarGetProgress(progressbar)
    setTimer( guiProgressBarSetProgress, 1000, 1,progressbar,lol+10 )
    setTimer( guiSetText, 1000, 1,label,"10%")
    setTimer( guiProgressBarSetProgress, 2000, 1,progressbar,lol+20 )
    setTimer( guiSetText, 2000, 1,label,"20%")
    setTimer( guiProgressBarSetProgress, 3000, 1,progressbar,lol+30 )
    setTimer( guiSetText, 3000, 1,label,"30%")
    setTimer( guiProgressBarSetProgress, 4000, 1,progressbar,lol+40 )
    setTimer( guiSetText, 4000, 1,label,"40%")
    setTimer( guiProgressBarSetProgress, 5000, 1,progressbar,lol+50 )
    setTimer( guiSetText, 5000, 1,label,"50%")
    setTimer( guiProgressBarSetProgress, 6000, 1,progressbar,lol+60 )
    setTimer( guiSetText, 6000, 1,label,"60%")
    setTimer( guiProgressBarSetProgress, 7000, 1,progressbar,lol+70 )
    setTimer( guiSetText, 7000, 1,label,"70%")
    setTimer( guiProgressBarSetProgress, 8000, 1,progressbar,lol+80 )
    setTimer( guiSetText, 8000, 1,label,"80%")
    setTimer( guiProgressBarSetProgress, 9000, 1,progressbar,lol+90 )
    setTimer( guiSetText, 9000, 1,label,"90%")
    setTimer( guiProgressBarSetProgress, 10000, 1,progressbar,lol+100 )
    setTimer( guiSetText, 10000, 1,label,"100%")
    timer = setTimer(function ()    
              guiSetVisible(window, false)
              showCursor(false)
              guiProgressBarSetProgress(progressbar, 0)
              unbindKey("tab","down",startN9)
              local num = math.random (#minerMarkers)
              local x = minerMarkers [num][1]
              local y = minerMarkers [num][2]
              local z = minerMarkers [num][3]
              setElementPosition(minerMark,x,y,z)
              setElementPosition(minerMarkk,x,y,z+2.0)
              setElementPosition(minerBlip,x,y,z)
              setElementPosition(minerObj,x,y,z)
              triggerServerEvent("giveW",localPlayer)
end,
10000,1)
end
 
 
addEventHandler("onClientMarkerHit",root,
function (hitting)
if source == minerMark then
if ( getElementData( hitting, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( hitting ) ) == "No Team" ) and not isPedInVehicle(hitting) then
bindKey("H","down",startJob)
end
end
end
)
 
addEventHandler("onClientMarkerLeave",root,
function ()
unbindKey("H","down",startJob)
end
)
 
fileDelete('jobClient.lua')
 
 
 
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        window22 = guiCreateWindow(451, 305, 264, 131, "[JopSystem]Iron Jop : Warring !!", false)
        guiWindowSetSizable(window22, false)
        guiSetAlpha(window22 , 1.00)
        guiSetProperty(window22, "CaptionColour", "FFFE0000")
        guiSetVisible (window22, false)
 
        label22 = guiCreateLabel(20, 23, 241, 31, "Are You Sure Want To Get Out Of The Job", false, window22)
        guiSetFont(label22, "default-bold-small")
        guiLabelSetColor(label22, 254, 0, 255)
        button11 = guiCreateButton(10, 64, 110, 54, "Yes", false, window22)
        button22 = guiCreateButton(143, 64, 110, 54, "No", false, window22)
end    
)
 
 
 
addEventHandler("onClientMarkerHit",root,
function ( hitElement )
    if ( source == Taxi1 ) then
                if ( hitElement == localPlayer ) then
                if ( getPlayerTeam ( localPlayer ) ) then
                if ( getElementData( localPlayer, 'Occupation' ) == "Miner-Jop" ) and ( getTeamName ( getPlayerTeam ( localPlayer ) ) == "No Team" ) and not isPedInVehicle(localPlayer) then
                guiSetVisible (window22, true)
                showCursor(true)
            end
          end
       end
     end
end
)
 
 
 
addEventHandler( "onClientGUIClick", root,
function()
if source ==  button11 then
triggerServerEvent('remveMiner', localPlayer)
guiSetVisible (window22, false)
showCursor (false)
destroyElement ( minerMark )
destroyElement ( minerMarkk )
destroyElement ( minerBlip )
destroyElement ( minerObj )
elseif source ==  button22 then
guiSetVisible (window22, false)
showCursor (false)
end
end
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...