0 Üye ve 1 Ziyaretçi konuyu incelemekte.
alan = createColSphere(2277.51294, -761.58533, 130.81004, 1000)tablo = {}ekpara = 0function meslek (plr,cmd,state) if isElementWithinColShape(plr,alan) then if not state then outputChatBox("Maden toplamak için :#FFFFFF /"..cmd.."<topla,sat>",plr,127,255,0,true) return end if not tablo[plr] then tablo[plr] = {} end if state == "topla" then if not isTimer(tablo[plr].zaman) then outputChatBox("Maden toplamaya başladın!",plr,0,0,255,true) setPedAnimation(plr,"baseball","bat_4") tablo[plr].zaman = setTimer (function() setElementData(plr,"maden:sayi",( getElementData(plr,"maden:sayi")or 0)+1) outputChatBox("Madeni topladın! Maden sayın:" ..getElementData(plr,"maden:sayi"),plr,205,51,51,true) setPedAnimation(plr) end,10000,1) else outputChatBox("Zaten maden topluyorsun!",plr,0,238,238,true) end end elseif state == "sat" then if (tonumber(getElementData(plr,"maden:sayi")) or 0 ) > 0 then if tonumber(getElementData(plr,"maden:sayi")) > 10 then ekpara = 30 end outputChatBox("Madenleri sattın!",plr,255,185,15,true) else outputChatBox("Maden satmak için maden toplaman gerek!",plr,255,127,36,true) end end else outputChatBox("Maden toplamak için :#FFFFFF /"..cmd.."<topla,sat>",plr,127,255,0,true) end else outputChatBox("Maden toplama alanında değilsiniz!",plr,255,0,0,true) return end end addCommandHandler("maden",meslek)
alan = createColSphere(2277.51294, -761.58533, 130.81004, 1000)tablo = {}ekpara = 0function meslek(plr,cmd,state) if isElementWithinColShape(plr,alan) then if not state then outputChatBox("Maden toplamak için :#FFFFFF /"..cmd.."<topla,sat>",plr,127,255,0,true) return end if not tablo[plr] then tablo[plr] = {} end if state == "topla" then if not isTimer(tablo[plr].zaman) then outputChatBox("Maden toplamaya başladın!",plr,0,0,255,true) setPedAnimation(plr,"baseball","bat_4") tablo[plr].zaman = setTimer (function() setElementData(plr,"maden:sayi",( getElementData(plr,"maden:sayi")or 0)+1) outputChatBox("Madeni topladın! Maden sayın:" ..getElementData(plr,"maden:sayi"),plr,205,51,51,true) setPedAnimation(plr) end,10000,1) else outputChatBox("Zaten maden topluyorsun!",plr,0,238,238,true) end elseif state == "sat" then if (tonumber(getElementData(plr,"maden:sayi")) or 0 ) > 0 then if tonumber(getElementData(plr,"maden:sayi")) > 10 then ekpara = 30 end outputChatBox("Madenleri sattın!",plr,255,185,15,true) else outputChatBox("Maden satmak için maden toplaman gerek!",plr,255,127,36,true) end else outputChatBox("Maden toplamak için :#FFFFFF /"..cmd.."<topla,sat>",plr,127,255,0,true) end else outputChatBox("Maden toplama alanında değilsiniz!",plr,255,0,0,true) endendaddCommandHandler("maden",meslek)