Jump to content

v36u

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by v36u

  1. Salut ! Am deschis de curând un nou server tradus complet în română ( urmează să adaug și un panou de schimbare a limbii dar asta pe viitor, vreau să ajungă popular momentan pe MTA-ul românesc ) și este un gamemode diferit de cele vanilla, are două inventare diferite și foarte multe sisteme noi, și de asemenea o mapă uriașă mărită de două ori într-o parte, și chiar mape alternative subterane ( metrouri ) . Dacă doriți să aruncați o privire și să vă dați cu părerea, vă aștept cu drag ^^ IP : mtasa://149.202.251.65:22003 PS: Da, are un GB și ceva dar se downloadează rapid datorită hostului so, no worries.
  2. v36u

    Bot Mute

    how can i enable the dev mode?
  3. v36u

    Bot Mute

    Hi guys, its me again, and i want to make zombies on a DayZ server shut up, like the characters are speaking if you push them or something like that ( like in San Andreas ) and i remember something about a function that makes them shut up, and i hope that works on the player character too. Please help, thanks in advance ^^
  4. v36u

    Hide-Show Chat

    thank you man, it worked ^^
  5. v36u

    Hide-Show Chat

    Ok so, i got this gamemode and it has a new inventory with some images and that inventory is very big, and the chat is over it, and i want to fix this. And, ignore my language. Ty again showChat ( true ) -- -- -- -- -- -- local screenWidth,screenHeight = guiGetScreenSize() local button = dxCreateTexture ( "inventory/butoff.png" ) local button2 = dxCreateTexture ( "inventory/butclick.png" ) local buttArrow = dxCreateTexture ( "inventory/buttArrow.png" ) local buttArrowDown = dxCreateTexture ( "inventory/buttArrowDown.png" ) inventoryShow = false bX, bY = screenWidth/2,screenHeight/2 loot = false inventory = {} inventoryWeap = {} inventoryWeap.main = {} inventoryWeap.addit = {} inventoryWeap.spec = {} inventoryWeap.ammo = {} rucksakSelectionLabels = {} foodInventory={} toolInventory={} gearName = '' loot = false prevY = 0 prevYPos = 0 itOff = 0 heightLabel = ((screenHeight/2+90)-5*(#inventory-9))-(screenHeight/2-235) local clicked=false scrollLabelSelected = false mainWeaponSelection = false additWeaponSelection = false selectedMainWeapon = 0 selectedAdditWeapon = 0 selectedItemLabel = 0 selectedFoodLabelID = 0 selectedToolLabelID = 0 selectedSpecLabelID = 0 foodLabelSelected = false specLabelSelected = false toolLabelSelected = false itemLabels = {} itemLabelsButtons = {} foodLabelsButtons={} toolLabelsButtons={} function getThisItemInLoot (name) local loot = isPlayerInLoot() if isElement(loot) then local item = getElementData ( loot, name ) return item or 0 else return 0 end end function removeItemFromInventory (name) for i, weap in ipairs ( inventoryWeap.main ) do if name == weap[1] then if selectedMainWeapon == i then selectedMainWeapon = 0 elseif selectedMainWeapon > i then selectedMainWeapon = selectedMainWeapon-1 end table.remove ( inventoryWeap.main, i ) end end for i, weap in ipairs ( inventoryWeap.addit ) do if name == weap[1] then if selectedMainWeapon == i then selectedMainWeapon = 0 elseif selectedMainWeapon > i then selectedMainWeapon = selectedMainWeapon-1 end table.remove ( inventoryWeap.addit, i ) end end for i, weap in ipairs ( inventoryWeap.spec ) do if name == weap[1] then table.remove ( inventoryWeap.spec, i ) end end for i, weap in ipairs ( foodInventory ) do if name == weap[1] then table.remove ( foodInventory, i ) end end for i, weap in ipairs ( toolInventory ) do if name == weap[1] then table.remove ( toolInventory, i ) end end end function placeItemsInInventory() local loot = isPlayerInLoot() inventory = {} inventoryWeap = {} inventoryWeap.main = {} inventoryWeap.addit = {} inventoryWeap.spec = {} foodInventory={} toolInventory={} if getElementData ( localPlayer, "Inventory_Setting" ) == 1 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Weapons['Primary Weapon'] ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 1 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Weapons['Secondary Weapon'] ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 2 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Ammo ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 1 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Weapons['Specially Weapon'] ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 3 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Food ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 4 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Medical ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 5 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Items ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 6 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Toolbelt ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 7 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Cloth ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end if getElementData ( localPlayer, "Inventory_Setting" ) == 7 or getElementData ( localPlayer, "Inventory_Setting" ) == 8 then for i, weap in ipairs ( inventoryItems.Skin ) do local inLoot = getThisItemInLoot (weap[1]) or 0 local inInventory = getElementData ( localPlayer, weap[1] ) or 0 if inLoot > 0 or inInventory > 0 then table.insert ( inventory, {weap[1],inLoot,inInventory,weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end end for i, weap in ipairs ( inventoryItems.Food ) do if getElementData ( localPlayer, weap[1] ) and getElementData ( localPlayer, weap[1] ) >= 1 then table.insert ( foodInventory, {weap[1],weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end for i, weap in ipairs ( inventoryItems.Toolbelt ) do if getElementData ( localPlayer, weap[1] ) and getElementData ( localPlayer, weap[1] ) >= 1 then table.insert ( toolInventory, {weap[1],weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end for i, weap in ipairs ( inventoryItems.Medical ) do if getElementData ( localPlayer, weap[1] ) and getElementData ( localPlayer, weap[1] ) >= 1 then table.insert ( inventoryWeap.spec, {weap[1],weap[3],weap[4],weap[5],weap[6],weap[7]} ) end end for i, weap in ipairs ( inventoryItems.Weapons['Primary Weapon'] ) do if getElementData ( localPlayer, weap[1] ) and getElementData ( localPlayer, weap[1] ) >= 1 then table.insert ( inventoryWeap.main, {weap[1],weap[3],weap[4],weap[5]} ) if getElementData(localPlayer, "currentweapon_1") == weap[1] then selectedMainWeapon = #inventoryWeap.main end end end for i, weap in ipairs ( inventoryItems.Weapons['Secondary Weapon'] ) do if getElementData ( localPlayer, weap[1] ) and getElementData ( localPlayer, weap[1] ) >= 1 then table.insert ( inventoryWeap.addit, {weap[1],weap[3],weap[4],weap[5],weap[6],weap[7]} ) if getElementData(localPlayer, "currentweapon_2") == weap[1] then selectedAdditWeapon = #inventoryWeap.addit end end end end function testoLabClick (but, state, x, y) clicked = false end addEventHandler( "onClientMouseWheel", root, function ( up_down ) if up_down == 1 then if itOff > 0 then itOff = itOff-1 prevY = prevY+5 guiSetPosition ( testoLab, screenWidth/2-13, screenHeight/2-235-prevY, false ) end else if itOff+9 < #inventory then itOff = itOff+1 prevY = prevY-5 guiSetPosition ( testoLab, screenWidth/2-13, screenHeight/2-235-prevY, false ) end end end ) function testoLabMove (x,y) if clicked then local newPrevY = prevY+prevYPos-y local tempVal = math.abs(prevY)-math.abs(newPrevY) if ( ( tempVal > 0 and prevY <= 0 ) or ( tempVal < 0 and itOff+9<#inventory ) ) and tempVal ~= 0 and prevY < 3 and prevY+newPrevY < 0 then prevY=newPrevY itOff = math.floor(math.abs(prevY/5)) prevYPos = y guiSetPosition ( testoLab, screenWidth/2-13, screenHeight/2-235-prevY, false ) end end end function buttonLabelEntered ( ) if getElementData ( source, 'scrollLabel' )then scrollLabelSelected = true -- stopAdditWeaponSelection () -- stopMainWeaponSelection () if selectedItemLabel ~= 0 then exports.imageButton:setImageButtonVisible ( itemLabelsButtons[selectedItemLabel][1].name, false ) exports.imageButton:setImageButtonVisible ( itemLabelsButtons[selectedItemLabel][2].name, false ) selectedItemLabel = 0 end end end function buttonLabelLeaved ( ) if getElementData ( source, 'scrollLabel' ) then scrollLabelSelected = false end end function checkOnButton () if scrollLabelSelected then local screenx, screeny, worldx, worldy, worldz = getCursorPosition() prevYPos = screeny*screenHeight clicked = true end end local inventoryButtAllowed = true function showInventoryManual () if not inventoryShow then initInventory () end end function unshowInventoryManual () if inventoryShow then closeInventory () end end function initInventory () if inventoryButtAllowed and getElementData(getLocalPlayer(), "logedin") and getElementData ( localPlayer, "Inventory" ) == 1 then inventoryButtAllowed = false setTimer ( function () inventoryButtAllowed = true end, 100, 1 ) if not inventoryShow then inventoryShow = true loot = false placeItemsInInventory () loot = isPlayerInLoot() if loot then gearName = getElementData(getLocalPlayer(), "lootname") end testoLab = guiCreateLabel ( screenWidth/2-16, screenHeight/2-235, 0.1, heightLabel, '', false ) setElementData ( testoLab, 'scrollLabel', true ) bindKey ( 'mouse1', 'down', checkOnButton ) bindKey ( 'mouse1', 'up', testoLabClick ) heightLabel = ((screenHeight/2+90)-5*(#inventory-9))-(screenHeight/2-235) addEventHandler ( "onClientMouseMove", testoLab, testoLabMove, false ) addEventHandler( "onClientMouseEnter", testoLab, buttonLabelEntered, false ) addEventHandler( "onClientMouseLeave", testoLab, buttonLabelLeaved, false ) exports.imageButton:createImageButton ( 'mainWeap', screenWidth/2+568,screenHeight/2-310, 64, 64, 0, ':UNION_DAYZ/inventory/butoff.png', ':UNION_DAYZ/inventory/butclick.png' ) exports.imageButton:createImageButton ( 'secWeap', screenWidth/2+568,screenHeight/2-240, 64, 64, 0, ':UNION_DAYZ/inventory/butoff.png', ':UNION_DAYZ/inventory/butclick.png' ) exports.imageButton:createImageButton ( 'Inventory_1', screenWidth/2-675,screenHeight/2+300, 89, 32, 0, ':UNION_DAYZ/inventory/icon1.png', ':UNION_DAYZ/inventory/icon1_on.png' ) exports.imageButton:createImageButton ( 'Inventory_2', screenWidth/2-590,screenHeight/2+300, 32, 32, 0, ':UNION_DAYZ/inventory/icon2.png', ':UNION_DAYZ/inventory/icon2_on.png' ) exports.imageButton:createImageButton ( 'Inventory_3', screenWidth/2-550,screenHeight/2+300, 44, 32, 0, ':UNION_DAYZ/inventory/icon3.png', ':UNION_DAYZ/inventory/icon3_on.png' ) exports.imageButton:createImageButton ( 'Inventory_4', screenWidth/2-500,screenHeight/2+300, 35, 32, 0, ':UNION_DAYZ/inventory/icon4.png', ':UNION_DAYZ/inventory/icon4_on.png' ) exports.imageButton:createImageButton ( 'Inventory_5', screenWidth/2-450,screenHeight/2+300, 32, 32, 0, ':UNION_DAYZ/inventory/icon5.png', ':UNION_DAYZ/inventory/icon5_on.png' ) exports.imageButton:createImageButton ( 'Inventory_6', screenWidth/2-400,screenHeight/2+300, 32, 32, 0, ':UNION_DAYZ/inventory/icon6.png', ':UNION_DAYZ/inventory/icon6_on.png' ) exports.imageButton:createImageButton ( 'Inventory_7', screenWidth/2-350,screenHeight/2+300, 32, 32, 0, ':UNION_DAYZ/inventory/icon7.png', ':UNION_DAYZ/inventory/icon7_on.png' ) exports.imageButton:createImageButton ( 'Inventory_8', screenWidth/2-307,screenHeight/2+300, 34, 32, 0, ':UNION_DAYZ/inventory/icon8.png', ':UNION_DAYZ/inventory/icon8_on.png' ) exports.imageButton:createImageButton ( 'Inventory_OLD', screenWidth/2+148+70,screenHeight/2+320, 64, 64, 0, ':UNION_DAYZ/inventory/old.png', ':UNION_DAYZ/inventory/old_on.png' ) addEventHandler ( "onClientRender", root, renderDisplay ) showChat ( false ) --Панель луту local yOff = 0 for i = 1, 9 do -- 385 и 350 local createdLabel = guiCreateLabel ( bX-675, bY-315+yOff, 400, 64, '', false ) setElementData ( createdLabel, 'itemLabel', true ) setElementData ( createdLabel, 'id', i ) addEventHandler( "onClientMouseEnter", createdLabel, itemLabelEntered, false ) addEventHandler( "onClientMouseLeave", createdLabel, itemLabelLeaved, false ) addEventHandler( "onClientGUIDoubleClick", createdLabel, itemLabelClicked, false ) local butt1 = exports.imageButton:createImageButton ( 'arrow'..i, bX-675, bY-315+yOff, 23, 64, 0, ':UNION_DAYZ/inventory/buttArrow.png', ':UNION_DAYZ/inventory/buttArrowDown.png' ) local butt2 = exports.imageButton:createImageButton ( 'arrowRev'..i, bX-297, bY-315+yOff, 23, 64, 180, ':UNION_DAYZ/inventory/buttArrow.png', ':UNION_DAYZ/inventory/buttArrowDown.png' ) exports.imageButton:setImageButtonVisible ( 'arrow'..i, false ) exports.imageButton:setImageButtonVisible ( 'arrowRev'..i, false ) table.insert ( itemLabelsButtons, { butt1, butt2 } ) table.insert ( itemLabels, createdLabel ) yOff = yOff+64 end --Панель їжі xOff = 148 for i = 1,6 do xOff = xOff+70 local createdLabel = guiCreateLabel ( bX+xOff, bY+110, 64, 64, '', false ) setElementData ( createdLabel, 'foodLabel', true ) setElementData ( createdLabel, 'id', i ) addEventHandler( "onClientMouseEnter", createdLabel, itemLabelEntered, false ) addEventHandler( "onClientMouseLeave", createdLabel, itemLabelLeaved, false ) addEventHandler ( "onClientGUIDoubleClick", createdLabel, rightItemClicked, false ) table.insert ( foodLabelsButtons, createdLabel ) end --Панель инструменти xOff = 148 for i = 1,6 do xOff = xOff+70 local createdLabel = guiCreateLabel ( bX+xOff, bY+250, 64, 64, '', false ) setElementData ( createdLabel, 'toolLabel', true ) setElementData ( createdLabel, 'id', i ) addEventHandler( "onClientMouseEnter", createdLabel, itemLabelEntered, false ) addEventHandler( "onClientMouseLeave", createdLabel, itemLabelLeaved, false ) addEventHandler ( "onClientGUIDoubleClick", createdLabel, rightItemClicked, false ) table.insert ( toolLabelsButtons, createdLabel ) end --Панель медикаменти xOff = 148 for i = 1,6 do xOff = xOff+70 local createdLabel = guiCreateLabel ( bX+xOff, bY-30, 64, 64, '', false ) setElementData ( createdLabel, 'specLabel', true ) setElementData ( createdLabel, 'id', i ) addEventHandler( "onClientMouseEnter", createdLabel, itemLabelEntered, false ) addEventHandler( "onClientMouseLeave", createdLabel, itemLabelLeaved, false ) addEventHandler ( "onClientGUIDoubleClick", createdLabel, rightItemClicked, false ) table.insert ( toolLabelsButtons, createdLabel ) end showCursor ( true ) else closeInventory () end end end function closeInventory() showCursor ( false ) unbindKey ( 'mouse1', 'down', checkOnButton ) unbindKey ( 'mouse1', 'up', testoLabClick ) if isElement (testoLab) then destroyElement ( testoLab ) end for i, label in ipairs ( itemLabels ) do if isElement ( label ) then destroyElement ( label ) end end for i, label in ipairs ( itemLabelsButtons ) do if isElement ( label ) then destroyElement ( label ) end end for i, label in ipairs ( foodLabelsButtons ) do if isElement ( label ) then destroyElement ( label ) end end for i, label in ipairs ( toolLabelsButtons ) do if isElement ( label ) then destroyElement ( label ) end end for i = 1, 9 do exports.imagebutton:destroyImageButtonByName('arrow'..i) exports.imagebutton:destroyImageButtonByName('arrowRev'..i) end removeEventHandler ( "onClientRender", root, renderDisplay ) exports.imagebutton:destroyImageButtonByName ('mainWeap') exports.imagebutton:destroyImageButtonByName ('secWeap') exports.imagebutton:destroyImageButtonByName ('Inventory_1') exports.imagebutton:destroyImageButtonByName ('Inventory_2') exports.imagebutton:destroyImageButtonByName ('Inventory_3') exports.imagebutton:destroyImageButtonByName ('Inventory_4') exports.imagebutton:destroyImageButtonByName ('Inventory_5') exports.imagebutton:destroyImageButtonByName ('Inventory_6') exports.imagebutton:destroyImageButtonByName ('Inventory_7') exports.imagebutton:destroyImageButtonByName ('Inventory_8') exports.imagebutton:destroyImageButtonByName ('Inventory_OLD') inventory = {} inventoryWeap = {} inventoryWeap.main = {} inventoryWeap.addit = {} inventoryWeap.spec = {} foodInventory={} toolInventory={} prevY = 0 prevYPos = 0 itOff = 0 loot = false clicked=false scrollLabelSelected = false mainWeaponSelection = false additWeaponSelection = false selectedMainWeapon = 0 selectedAdditWeapon = 0 selectedItemLabel = 0 selectedFoodLabelID = 0 selectedToolLabelID = 0 selectedSpecLabelID = 0 foodLabelSelected = false specLabelSelected = false toolLabelSelected = false itemLabels = {} itemLabelsButtons = {} foodLabelsButtons={} toolLabelsButtons={} inventoryShow = false end addEvent("closeInventory",true) addEventHandler("closeInventory",getLocalPlayer(),closeInventory) itemLabelClickAvail = true function itemLabelClicked () if getElementData ( source, 'itemLabel' ) then if isPlayerInLoot () then startRollMessage2("Inventar", "", 255, 22, 0) return false end if not itemLabelClickAvail then return false end itemLabelClickAvail = false setTimer ( function () itemLabelClickAvail = true end, 100, 1 ) local name, info = getInventoryInfosForRightClickMenu ( inventory[getElementData ( source, 'id' )+itOff][1] ) if ( getElementData ( localPlayer, name ) or 0 ) <= 0 then return true end if name == "Chibrituri" then if getElementData(getLocalPlayer(),"Lemn") == 0 then return end end if name == "Bandaj" then if getElementData(getLocalPlayer(),"bleeding") == 0 then return end end if name == "Mini Pachet cu sânge" then if getElementData(getLocalPlayer(),"blood") > 10500 then return end end if name == "Încălzitor" then if getElementData(getLocalPlayer(),"temperature") > 35 then return end end if name == "Morfină" then if not getElementData(getLocalPlayer(),"brokenbone") then return end end if name == "Conservă de sardine ( închisă )" or name == "Conservă de spaghette ( închisă )" or name == "Conservă de ton ( închisă )" or name == "Conservă de piersici ( închisă )" or name == "Conservă de șuncă ( închisă )" then if getElementData(getLocalPlayer(),"Deschizător") == 0 then return end end if info then playerUseItem(name, info) setTimer(placeItemsInInventory, 100, 1) end end end function rightItemClicked () local id = getElementData ( source, 'id' ) if getElementData ( source, 'foodLabel' ) then local name = foodInventory[id][1] if name == "Ploscă" or name == "Sticlă de apă" or name == "NotaCola" or name == "Pipsi" or name == "Băutură rusească" or name == "Spite" or name == "Водка" then playerUseItem ( name, 'Bea' ) elseif name == "Conservă de sardine ( închisă )" or name == "Conservă de spaghette ( închisă )" or name == "Conservă de ton ( închisă )" or name == "Conservă de piersici ( închisă )" or name == "Conservă de șuncă ( închisă )" then playerUseItem ( name, 'Deschide' ) else playerUseItem ( name, 'Mănâncă' ) end setTimer(placeItemsInInventory, 100, 1) elseif getElementData ( source, 'toolLabel' ) then local name = toolInventory[id][1] for i,itemInfo in ipairs(inventoryItems.Toolbelt) do if name == itemInfo[1] then if #itemInfo >= 6 then if name == "Chibrituri" then if getElementData(getLocalPlayer(),"Lemn") <= 0 then return end end playerUseItem ( name, itemInfo[8] ) end end end elseif getElementData ( source, 'specLabel' ) then local name = inventoryWeap.spec[id][1] for i,itemInfo in ipairs(inventoryItems.Medical) do if name == itemInfo[1] then if #itemInfo >= 6 then if name == "Bandaj" then if getElementData(getLocalPlayer(),"bleeding") == 0 then return end end if name == "Mini Pachet cu sânge" then if getElementData(getLocalPlayer(),"blood") > 10500 then return end end if name == "Încălzitor" then if getElementData(getLocalPlayer(),"temperature") > 35 then return end end if name == "Painkiller" then if not getElementData(getLocalPlayer(),"pain") then return end end if name == "Morfină" then if not getElementData(getLocalPlayer(),"brokenbone") then return end end if name == "Pachet cu sânge" then return end playerUseItem ( name, itemInfo[8] ) end end end end end function stopMainWeaponSelection () mainWeaponSelection = false for i, label in ipairs(mainWeapSelectionLabels) do if isElement ( label ) then destroyElement ( label ) label = nil end end end function stopAdditWeaponSelection () additWeaponSelection = false for i, label in ipairs(additWeapSelectionLabels) do if isElement ( label ) then destroyElement ( label ) label = nil end end end function itemLabelEntered () if getElementData ( source, 'itemLabel' ) then local id = getElementData ( source, 'id' ) if selectedItemLabel ~= 0 then exports.imageButton:setImageButtonVisible ( itemLabelsButtons[selectedItemLabel][1].name, false ) exports.imageButton:setImageButtonVisible ( itemLabelsButtons[selectedItemLabel][2].name, false ) end if id <= #inventory then selectedItemLabel = id exports.imageButton:setImageButtonVisible ( itemLabelsButtons[id][1].name, true ) exports.imageButton:setImageButtonVisible ( itemLabelsButtons[id][2].name, true ) end elseif getElementData ( source, 'foodLabel' ) then foodLabelSelected = true selectedFoodLabelID = getElementData ( source, 'id' ) elseif getElementData ( source, 'toolLabel' ) then toolLabelSelected = true selectedToolLabelID = getElementData ( source, 'id' ) elseif getElementData ( source, 'specLabel' ) then specLabelSelected = true selectedSpecLabelID = getElementData ( source, 'id' ) end end function itemLabelLeaved () if getElementData ( source, 'itemLabel' ) then --local id = getElementData ( source, 'id' ) --exports.imageButton:setImageButtonVisible ( itemLabelsButtons[id][1].name, false ) --exports.imageButton:setImageButtonVisible ( itemLabelsButtons[id][2].name, false ) --selectedItemLabel = 0 elseif getElementData ( source, 'foodLabel' ) then foodLabelSelected = false selectedFoodLabelID = 0 elseif getElementData ( source, 'toolLabel' ) then toolLabelSelected = false selectedToolLabelID = 0 elseif getElementData ( source, 'specLabel' ) then specLabelSelected = false selectedSpecLabelID = 0 end end NameWindow = dxCreateFont("inventory/fanbox.otf", 22) fanboxInfo = dxCreateFont("inventory/loot.otf", 14) fanboxStata = dxCreateFont("inventory/fanbox.otf", 14) fanbox = dxCreateFont("inventory/loot.otf", 10) Button = dxCreateFont("inventory/fanbox.otf", 16) fanboxInfoLoot = dxCreateFont("inventory/loot.otf", 16) fanboxIn = dxCreateFont("inventory/loot.otf", 12) function renderDisplay ( ) dxDrawImage ( bX-700, bY-400, 450, 800, "inventory/FAN_1.png" ) -- Лут < dxDrawImage ( bX-250, bY-397, 450, 794, "inventory/FAN_2.png" ) -- Пед dxDrawImage ( bX+200, bY-400, 450, 800, "inventory/FAN_1.png" ) -- Лут > dxDrawRectangle (bX-693, bY-325, 436, 2, tocolor (132,132,132,75)) -- Лут < Полоска dxDrawRectangle (bX-245, bY-325, 440, 2, tocolor (132,132,132,75)) -- Пед Полоска dxDrawRectangle (bX+207, bY-325, 436, 2, tocolor (132,132,132,75)) -- Лут > Полоска dxDrawText ( 'LUCRURI', bX-500, bY-375, bX-300, bY-280, tocolor (255,255,255,255), 1, NameWindow )-- РЕЧІ dxDrawText ( 'STATUS', bX-60, bY-375, bX-300, bY-280, tocolor (255,255,255,255), 1, NameWindow )-- СТАТУС dxDrawText ( 'INVENTAR', bX+365, bY-375, bX-300, bY-280, tocolor (255,255,255,255), 1, NameWindow )-- Inventar dxDrawImage ( bX-682, bY-315, 415, 800, "inventory/FAN_3.png" ) -- Фон лута if loot then placeItemsInInventory () local curLootItems = getLootCurrentSlots(loot) or 0 local maxLootItems = getLootMaxAviableSlots(loot) or 0 if maxLootItems > 0 then dxDrawText ( ''..curLootItems .. '/' .. maxLootItems, bX-327, bY-363, bX-300, bY-280, tocolor ( 132,132,132,255), 1, fanboxInfo,"right" )--Найдений лут dxDrawImage ( bX-292, bY-368, 25, 25, "inventory/box.png" ) -- слот dxDrawText ( gearName, bX-680, bY-363, bX-300, bY-280, tocolor ( 132,132,132,255), 1, fanboxInfo)--Назва обэкту end end dxDrawText (getPlayerCurrentSlots() .. '/' .. getPlayerMaxAviableSlots()..'', bX+560, bY-363, bX-300, bY-280, tocolor ( 132,132,132,255), 1, fanboxInfo)--Твій лут dxDrawImage ( bX+610, bY-368, 30, 30, "inventory/masa.png" ) -- маса --local itScroll = (bY+90)-5*(#inventory-11) --dxDrawLine ( bX-10, bY-235-prevY, bX-10, itScroll-prevY, tocolor ( 80, 60, 40, 255 ), 15 ) dxDrawRectangle (bX-674, bY+284, 402, 9, tocolor (132,132,132,255)) -- ПОЛОСКА ПОЛЗУНКА if getElementData ( localPlayer, "Inventory_Setting") == 1 then dxDrawText ( 'Arme', bX-500, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-500, bY+370, 59, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 2 then dxDrawText ( 'Muniție', bX-515, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-515, bY+370, 94, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 3 then dxDrawText ( 'Mâncare/Băutură', bX-515, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-515, bY+370, 103, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 4 then dxDrawText ( 'Medicină', bX-515, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-515, bY+370, 109, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 5 then dxDrawText ( 'Altele', bX-500, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-500, bY+370, 54, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 6 then dxDrawText ( 'Unelte', bX-515, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-515, bY+370, 106, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 7 then dxDrawText ( 'Îmbrăcăminte', bX-500, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-500, bY+370, 62, 2, tocolor (132,132,132,175)) elseif getElementData ( localPlayer, "Inventory_Setting") == 8 then dxDrawText ( 'TOT', bX-490, bY+345, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX-490, bY+370, 26, 2, tocolor (132,132,132,175)) end SkinImages = { {100,"inventory/skin_1.png"}, {101,"inventory/skin_2.png"}, {102,"inventory/skin_3.png"}, {103,"inventory/skin_4.png"}, {104,"inventory/skin_5.png"}, {105,"inventory/skin_6.png"}, {106,"inventory/skin_25.png"}, {107,"inventory/skin_7.png"}, {108,"inventory/skin_8.png"}, {109,"inventory/skin_9.png"}, {110,"inventory/skin_10.png"}, {111,"inventory/skin_11.png"}, {112,"inventory/skin_12.png"}, {113,"inventory/skin_13.png"}, {114,"inventory/skin_14.png"}, {115,"inventory/skin_15.png"}, {116,"inventory/skin_16.png"}, {117,"inventory/skin_17.png"}, {118,"inventory/skin_18.png"}, {120,"inventory/skin_19.png"}, {121,"inventory/skin_20.png"}, {122,"inventory/skin_21.png"}, {123,"inventory/skin_22.png"}, {124,"inventory/skin_23.png"}, {125,"inventory/skin_24.png"}, } for _, skin in ipairs(SkinImages) do if getElementData ( localPlayer, "skin") == skin[1] then dxDrawImage ( bX-215, bY-250, 242, 312, skin[2] ) end end clothHead = { {"Beretă Militară Roșie","icons/201.union"}, {"Beretă Neagră","icons/202.union"}, {"Beretă Albastră","icons/203.union"}, {"Beretă Verde","icons/204.union"}, {"Beretă Militară Bej","icons/295.union"}, {"Pălărie Neagră","icons/121.union"}, {"Pălărie Albastră","icons/118.union"}, {"Pălărie cu Camuflaj №1","icons/114.union"}, {"Pălărie cu Camuflaj №2","icons/117.union"}, {"Pălărie cu Camuflaj №3","icons/115.union"}, {"Pălărie Gri","icons/122.union"}, {"Pălărie Verde","icons/116.union"}, {"Pălărie Portocalie","icons/119.union"}, {"Pălărie Roșie","icons/113.union"}, {"Pălărie Bej","icons/120.union"}, {"Ghillie Pentru Cap №1","icons/155.union"}, {"Ghillie Pentru Cap №2","icons/156.union"}, {"Ghillie Pentru Cap №3","icons/154.union"}, {"Cască E ( Verde )","icons/111.union"}, {"Cască E ( Neagră )","icons/112.union"}, {"Шлем Горка Е (SWAT","icons/112.union"}, {"Cască E ( Camo )","icons/299.union"}, {"Fes Albastru de Medic","icons/166.union"}, {"Fes Verde de Medic","icons/307.union"}, {"Fes Alb de Medic","icons/308.union"}, {"Cască Militară Verde","icons/3.union"}, {"Cască Militară Neagră","icons/2.union"}, {"Cască Militară Albastră","icons/1.union"}, {"Cască Militară Camuflată №1","icons/298.union"}, {"Cască Militară Camuflată №2","icons/296.union"}, {"Cască Militară Camuflată №3","icons/297.union"}, {"Pălărie de Cowboy Maro","icons/191.union"}, {"Pălărie de Cowboy Neagră","icons/193.union"}, {"Pălărie de Cowboy Maro Închis","icons/194.union"}, {"Pălărie de Cowboy Verde","icons/192.union"}, {"Pălărie de Cowboy Gri","icons/300.union"}, {"Pălărie de Cowboy Albă","icons/301.union"}, {"Fes Maro Croșetat","icons/160.union"}, {"Fes Negru Croșetat","icons/163.union"}, {"Fes Albastru Croșetat","icons/158.union"}, {"Fes Maro Închis Croșetat","icons/157.union"}, {"Fes Verde Croșetat","icons/162.union"}, {"Fes Gri Croșetat","icons/159.union"}, {"Fes Roșu Croșetat","icons/161.union"}, {"Șapcă Plată cu carouri Albastre","icons/144.union"}, {"Șapcă Plată Neagră","icons/145.union"}, {"Șapcă Plată Albastră","icons/139.union"}, {"Șapcă Plată cu carouri Albe","icons/143.union"}, {"Șapcă Plată Maro","icons/140.union"}, {"Șapcă Plată cu carouri Gri","icons/141.union"}, {"Șapcă Plată Gri","icons/142.union"}, {"Șapcă Plată Roșie","icons/138.union"}, {"Cască Neagră de Muncitor","icons/302.union"}, {"Cască Albastră de Muncitor","icons/108.union"}, {"Cască Verde de Muncitor №1","icons/303.union"}, {"Cască Verde de Muncitor №2","icons/109.union"}, {"Cască Portocalie de Muncitor","icons/105.union"}, {"Cască Roșie de Muncitor","icons/106.union"}, {"Cască Albă de Muncitor","icons/107.union"}, {"Cască Galbenă de Muncitor","icons/110.union"}, {"Cască Neagră de Pompier","icons/304.union"}, {"Cască Roșie de Pompier","icons/104.union"}, {"Cască Albă de Pompier","icons/103.union"}, {"Cască Galbenă de Pompier","icons/102.union"}, {"Cască Neagră de Pilot","icons/306.union"}, {"Cască Albă de Pilot","icons/153.union"}, {"Cască Verde de Pilot","icons/305.union"}, {"Медециньска шапка Синяя","icons/166.union"}, {"Медециньска шапка Зелёная","icons/307.union"}, {"Медециньска шапка Белая","icons/308.union"}, {"Caschetă de sub-ofițer","icons/190.union"}, {"Beretă","icons/205.union"}, {"Caschetă de ofițer","icons/213.union"}, {"Șapcă №1","icons/137.union"}, {"Șapcă №2","icons/129.union"}, {"Șapcă №3","icons/130.union"}, {"Șapcă №4","icons/132.union"}, {"Șapcă №5","icons/133.union"}, {"Șapcă №6","icons/131.union"}, {"Șapcă №7","icons/134.union"}, {"Șapcă №8","icons/135.union"}, {"Fes Negru cu Urechi","icons/123.union"}, {"Fes Albastru cu Urechi","icons/125.union"}, {"Fes Verde cu Urechi","icons/124.union"}, {"Bandană pentru Cap ( Camo )","icons/183.union"}, {"Bandană pentru Cap ( Neagră )","icons/184.union"}, {"Bandană pentru Cap ( Violet )","icons/186.union"}, {"Bandană pentru Cap ( Roșie )","icons/187.union"}, {"Bandană pentru Cap ( Galbenă )","icons/188.union"}, {"Bandană pentru Cap ( Verde )","icons/185.union"}, {"Fes Negru","icons/220.union"}, {"Fes Maro","icons/219.union"}, {"Fes Verde","icons/216.union"}, {"Fes Roșu","icons/217.union"}, {"Fes Albastru","icons/218.union"}, {"Cască de tip Tank","icons/206.union"}, {"Fes Negru Croșetat cu Moț","icons/175.union"}, {"Fes Albastru Croșetat cu Moț","icons/177.union"}, {"Fes Maro Croșetat cu Moț","icons/178.union"}, {"Fes Roșu Croșetat cu Moț","icons/176.union"}, {"Fes Verde Croșetat cu Moț","icons/174.union"}, } clothHeadN = { {"Cagulă ( Neagră cu un craniu )","icons/94.union"}, {"Cagulă ( Bej )","icons/97.union"}, {"Cagulă ( Neagră )","icons/100.union"}, {"Cagulă ( Albastră )","icons/98.union"}, {"Cagulă ( Verde )","icons/99.union"}, {"Cagulă ( Roz )","icons/95.union"}, {"Cagulă ( Albă )","icons/96.union"}, {"Cagulă ( Camo )","icons/293.union"}, {"Masca lui Dallas","icons/128.union"}, {"Masca lui Hoxton","icons/126.union"}, {"Masca lui Wolf","icons/127.union"}, {"Mască de gaze","icons/189.union"}, {"Cască de motociclist №1","icons/152.union"}, {"Cască de motociclist №2","icons/148.union"}, {"Cască de motociclist №3","icons/149.union"}, {"Cască de motociclist №4","icons/146.union"}, {"Cască de motociclist №5","icons/151.union"}, {"Cască de motociclist №6","icons/147.union"}, {"Cască de motociclist №7","icons/150.union"}, {"Bandană ( Camo )","icons/198.union"}, {"Bandană ( Neagră )","icons/196.union"}, {"Bandană ( Violet )","icons/199.union"}, {"Bandană ( Roșie )","icons/197.union"}, {"Bandană ( Galbenă )","icons/294.union"}, {"Bandană ( Verde )","icons/195.union"}, } clothEis = { {"Ochelari de soare de designer","icons/212.union"}, {"Ochelari de soare","icons/17.union"}, } clothBody = { {"Vestă cu mici depozite","icons/209.union"}, -- 10 {"Vestă anti-șoc","icons/200.union"}, {"Vestă PRESS","icons/164.union"}, --12 {"Vestă cu capacitate mare ( Neagră )","icons/211.union"}, {"Vestă cu capacitate mare ( Verde )","icons/210.union"}, {"Vestă cu capacitate mare ( Camo )","icons/309.union"}, --8 {"Vestă Militară Neagră","icons/310.union"}, {"Vestă Militară DPM Camo","icons/312.union"}, {"Vestă Militară Verde","icons/311.union"}, {"Vestă Militară Khaki","icons/313.union"}, {"Vestă PRESS Albastră","icons/165.union"}, --8 {"Vestă Militară №2 Neagră","icons/181.union"}, {"Vestă Militară №2 DPM Camo","icons/180.union"}, {"Vestă Militară №2 Verde","icons/182.union"}, {"Vestă Militară №2 Khaki","icons/179.union"}, {"Vestă PRESS Camo","icons/314.union"}, --12 {"Vestă Militară Verde Camo","icons/316.union"}, --16 {"Vestă SMRESH","icons/14.union"}, --8 {"Vestă Militară Maro","icons/317.union"}, {"Vestă PRESS Camo №2","icons/315.union"}, --8 {"Vestă Militară Camo №1","icons/318.union"}, {"Vestă Militară Camo №2","icons/319.union"}, } clothGila = { {"Ghillie Pentru Corp №1","icons/18.union"}, {"Ghillie Pentru Corp №2","icons/207.union"}, {"Ghillie Pentru Corp №3","icons/208.union"}, } Rukzak = { {1,"icons/43.union"}, -- Ghiozdan Montan Verde {2,"icons/7.union"}, -- Ghiozdan Montan Roșu {3,"icons/44.union"}, -- Ghiozdan Montan Portocaliu {4,"icons/42.union"}, -- Ghiozdan Montan Albastru {5,"icons/284.union"}, -- Ghiozdan Montan Camuflat {6,"icons/226.union"}, -- Ghiozdan Tortilla №1 {7,"icons/285.union"}, -- Ghiozdan Tortilla №2 {8,"icons/286.union"}, -- Ghiozdan Tortilla №3 {9,"icons/287.union"}, -- Ghiozdan Tortilla №4 {10,"icons/7.union"}, -- Rucsac de vânătoare №1 {11,"icons/290.union"}, -- Rucsac de vânătoare №2 {12,"icons/291.union"}, -- Rucsac de vânătoare №3 {13,"icons/289.union"}, -- Rucsac de vânătoare №4 {14,"icons/288.union"}, -- Rucsac de vânătoare №5 {15,"icons/169.union"}, -- DryBag Galben {16,"icons/171.union"}, -- DryBag Verde {17,"icons/173.union"}, -- DryBag Roșu {18,"icons/170.union"}, -- DryBag Portocaliu {19,"icons/168.union"}, -- DryBag Albastru {20,"icons/172.union"}, -- DryBag Negru {21,"icons/41.union"}, -- Rucsac Verde {22,"icons/39.union"}, -- Rucsac Portocaliu {23,"icons/38.union"}, -- Rucsac Albastru {24,"icons/40.union"}, -- Rucsac Violet {25,"icons/292.union"}, -- Rucsac Camuflat {26,"icons/92.union"}, -- Ghiozdan M53 Boulder Camuflat {27,"icons/91.union"}, -- Ghiozdan M53 Boulder Negru {28,"icons/93.union"}, -- Ghiozdan M53 Boulder Verde {29,"icons/215.union"}, -- Ghiozdan SMRESH {30,"icons/222.union"}, -- Sac făcut manual {31,"icons/223.union"}, -- Sac din piele {32,"icons/221.union"}, -- Sac din piele ( mai mare ) {33,"icons/251.union"}, -- Ghiozdan făcut manual {34,"icons/224.union"}, -- Ghiozdan din piele făcut manual {35,"icons/167.union"}, --Portofoliul unui copil {36,"icons/225.union"}, -- Ghiozdan Coyote } dxDrawRectangle (bX-233, bY+135, 64, 64, tocolor (132,132,132,75))--Голова dxDrawRectangle (bX-162, bY+135, 64, 64, tocolor (132,132,132,75))--Шия dxDrawRectangle (bX-92, bY+135, 64, 64, tocolor (132,132,132,75))--Очки dxDrawRectangle (bX-22, bY+135, 64, 64, tocolor (132,132,132,75))--Рюкзак dxDrawRectangle (bX+49, bY+135, 64, 64, tocolor (132,132,132,75))--Жилет dxDrawRectangle (bX+120, bY+135, 64, 64, tocolor (132,132,132,75))--Гиля --Голова for _, clothHead in ipairs(clothHead) do if getElementData ( getLocalPlayer(), "clothHead",false) == clothHead[1] then dxDrawImage ( bX-233, bY+135, 64, 64, clothHead[2] ) end end --Шия for _, clothHeadN in ipairs(clothHeadN) do if getElementData ( getLocalPlayer(), "clothHeadN",false) == clothHeadN[1] then dxDrawImage ( bX-162, bY+135, 64, 64, clothHeadN[2] ) end end --Очки for _, clothEis in ipairs(clothEis) do if getElementData ( getLocalPlayer(), "clothEis",false) == clothEis[1] then dxDrawImage ( bX-92, bY+135, 64, 64, clothEis[2] ) end end --Рюкзак for _, Rukzak in ipairs(Rukzak) do if getElementData ( getLocalPlayer(), "Rukzak",false) == Rukzak[1] then dxDrawImage ( bX-22, bY+135, 64, 64, Rukzak[2] ) end end --Жилет for _, clothBody in ipairs(clothBody) do if getElementData ( getLocalPlayer(), "clothBody",false) == clothBody[1] then dxDrawImage ( bX+49, bY+135, 64, 64, clothBody[2] ) end end --Гиля for _, clothGila in ipairs(clothGila) do if getElementData ( getLocalPlayer(), "clothGila",false) == clothGila[1] then dxDrawImage ( bX+120, bY+135, 64, 64, clothGila[2] ) end end if getElementData ( getLocalPlayer(), "clothHead") == false then dxDrawImage (bX-227, bY+140, 50, 50, "inventory/stat_1.png" ) --Голова end if getElementData ( getLocalPlayer(), "clothHeadN") == false then dxDrawImage (bX-157, bY+140, 50, 50, "inventory/stat_2.png" ) --Шия end if getElementData ( getLocalPlayer(), "clothEis") == false then dxDrawImage (bX-87, bY+140, 50, 50, "inventory/stat_5.png" ) --Очки end if getElementData ( getLocalPlayer(), "Rukzak") == 0 then dxDrawImage (bX-17, bY+140, 50, 50, "inventory/stat_4.png" ) --Рюкзак end if getElementData ( getLocalPlayer(), "clothBody") == false then dxDrawImage (bX+54, bY+140, 50, 50, "inventory/stat_3.png" ) --Жилет end if getElementData ( getLocalPlayer(), "clothGila") == false then dxDrawImage (bX+127, bY+140, 50, 50, "inventory/stat_6.png" ) --Гиля end -- Начало инфы о предмете --Инфа з панелі лута if selectedItemLabel > 0 then if selectedItemLabel <= #inventory then dxDrawText ( inventory[selectedItemLabel+itOff][1], bX-230, bY+220, screenWidth, screenHeight, tocolor ( 255,10,10,150), 1, fanboxInfoLoot ) dxDrawText ( inventory[selectedItemLabel+itOff][7], bX-230, bY+340, screenWidth, screenHeight, tocolor ( 132,132,132,175), 1, fanboxInfo ) dxDrawText ( inventory[selectedItemLabel+itOff][8], bX-230, bY+360, screenWidth, screenHeight, tocolor ( 255,255,255,175), 1, fanboxIn ) local sizeX = 200 local offX = -50 if inventory[selectedItemLabel+itOff][5]/inventory[selectedItemLabel+itOff][6] == 1 then offX = 0 sizeX = 100 end dxDrawImage ( bX+35+offX, bY+245, sizeX, 100, 'icons/'..inventory[selectedItemLabel+itOff][4] ) end elseif foodLabelSelected then if selectedFoodLabelID <= #foodInventory then dxDrawText ( foodInventory[selectedFoodLabelID][1], bX-230, bY+220, screenWidth, screenHeight, tocolor ( 255,10,10,150), 1, fanboxInfoLoot ) dxDrawText ( foodInventory[selectedFoodLabelID][5], bX-230, bY+340, screenWidth, screenHeight, tocolor ( 132,132,132,175), 1, fanboxInfo ) dxDrawText ( foodInventory[selectedFoodLabelID][6], bX-230, bY+360, screenWidth, screenHeight, tocolor ( 255,255,255,175), 1, fanboxIn ) dxDrawImage ( bX-40+offX, bY+245, 100, 100, 'icons/'..foodInventory[selectedFoodLabelID][2] ) end elseif toolLabelSelected then if selectedToolLabelID <= #toolInventory then dxDrawText ( toolInventory[selectedToolLabelID][1], bX-230, bY+220, screenWidth, screenHeight, tocolor ( 255,10,10,150), 1, fanboxInfoLoot ) dxDrawText ( toolInventory[selectedToolLabelID][5], bX-230, bY+340, screenWidth, screenHeight, tocolor ( 132,132,132,175), 1, fanboxInfo ) dxDrawText ( toolInventory[selectedToolLabelID][6], bX-230, bY+360, screenWidth, screenHeight, tocolor ( 255,255,255,175), 1, fanboxIn ) dxDrawImage ( bX-40+offX, bY+245, 100, 100, 'icons/'..toolInventory[selectedToolLabelID][2] ) end elseif specLabelSelected then if selectedSpecLabelID <= #inventoryWeap.spec then dxDrawText ( inventoryWeap.spec[selectedSpecLabelID][1], bX-230, bY+220, screenWidth, screenHeight, tocolor ( 255,10,10,150), 1, fanboxInfoLoot ) dxDrawText ( inventoryWeap.spec[selectedSpecLabelID][5], bX-230, bY+340, screenWidth, screenHeight, tocolor ( 132,132,132,175), 1, fanboxInfo ) dxDrawText ( inventoryWeap.spec[selectedSpecLabelID][6], bX-230, bY+360, screenWidth, screenHeight, tocolor ( 255,255,255,175), 1, fanboxIn ) dxDrawImage ( bX-40+offX, bY+245, 100, 100, 'icons/'..inventoryWeap.spec[selectedSpecLabelID][2] ) end end statsTable = { "Plin", "Viguros", "Înfometat", "Însetat", "Defect", "Dezhidratat", "Otrăvit", "Infecție", "Fractură", "Hipotermie", "Beat", "Fumat", "Sângerare", "Răceală", "Durere", "Obosit", } colors1 = { 75, 165, 95, 210, 200, 30, 215, } colors2 = { 120, 145, 25, 105, 10, 45, 115, } colors3 = { 45, 50, 25, 30, 10, 200, 140, } local tmptable = {} local setcolor1 = {} local setcolor2 = {} local setcolor3 = {} --сыт if getElementData(getLocalPlayer(), "food") >= 60 and getElementData(getLocalPlayer(), "food") <= 100 then table.insert (tmptable,1) table.insert (setcolor1,1) table.insert (setcolor2,1) table.insert (setcolor3,1) end --энергичный if getElementData(getLocalPlayer(), "thirst") >= 60 and getElementData(getLocalPlayer(), "thirst") <= 100 then table.insert (tmptable,2) table.insert (setcolor1,1) table.insert (setcolor2,1) table.insert (setcolor3,1) end --голодный if getElementData(getLocalPlayer(), "food") >= 20 and getElementData(getLocalPlayer(), "food") <= 60 then table.insert (tmptable,3) table.insert (setcolor1,2) table.insert (setcolor2,2) table.insert (setcolor3,2) end --жажда if getElementData(getLocalPlayer(), "thirst") >= 20 and getElementData(getLocalPlayer(), "thirst") <= 60 then table.insert (tmptable,4) table.insert (setcolor1,2) table.insert (setcolor2,2) table.insert (setcolor3,2) end --нехватка if getElementData(getLocalPlayer(), "food") >= 1 and getElementData(getLocalPlayer(), "food") <= 20 then table.insert (tmptable,5) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end --обезвоженный if getElementData(getLocalPlayer(), "thirst") >= 1 and getElementData(getLocalPlayer(), "thirst") <= 20 then table.insert (tmptable,6) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end --отравлення if getElementData(getLocalPlayer(), "sick") == 60 then table.insert (tmptable,7) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end --отравлення if getElementData(getLocalPlayer(), "infection_zom") >= 1 then table.insert (tmptable,8) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end if getElementData(getLocalPlayer(), "brokenbone", true) then table.insert (tmptable,9) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end if getElementData(getLocalPlayer(), "cold", true) then table.insert (tmptable,10) table.insert (setcolor1,6) table.insert (setcolor2,6) table.insert (setcolor3,6) end if 0 < getElementData(getLocalPlayer(), "bleeding") then table.insert (tmptable,13) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end if getElementData(getLocalPlayer(), "grip") == 1 then table.insert (tmptable,14) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end if getElementData(getLocalPlayer(), "pain", true) then table.insert (tmptable,15) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end if getElementData(getLocalPlayer(), "sleep") <= 150 then table.insert (tmptable,16) table.insert (setcolor1,3) table.insert (setcolor2,3) table.insert (setcolor3,3) end for i = 1, #tmptable do for i = 1, #setcolor1 do for i = 1, #setcolor2 do for i = 1, #setcolor3 do local textw = dxGetTextWidth(statsTable[tmptable[i]],1,fanboxStata)-75 dxDrawText(statsTable[tmptable[i]], bX+(10+textw), bY-415+60*i, bX+180, bY-250, tocolor(205,205,205,150), 1, fanboxStata, "center", "center", false, false, true, false, false) dxDrawRectangle( bX+(50), bY-347+30*i, 140, 25, tocolor(colors1[setcolor1[i]],colors2[setcolor2[i]],colors3[setcolor3[i]],175)) end end end end -- отOrezовка статсов -- Конец инфы о предмете dxDrawRectangle (bX+148+70, bY+-310, 414, 64, tocolor (255, 10, 10, 12))--Основна оружка dxDrawRectangle (bX+148+70, bY+-240, 414, 64, tocolor (255, 10, 10, 12))--Другорядна оружка dxDrawRectangle (bX+148+70, bY+-170, 414, 64, tocolor (255, 10, 10, 12))--Другорядна оружка dxDrawText ( 'Medicină', bX+300+70, bY-100, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX+300+70, bY-75, 109, 2, tocolor (255,255,255,175)) dxDrawImage ( bX+335+70, bY-70, 35, 31, 'inventory/icon4.png') dxDrawText ( 'Mâncare și băutură', bX+305+70, bY+40, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX+305+70, bY+65, 103, 2, tocolor (255,255,255,175)) dxDrawImage ( bX+335+70, bY+70, 44, 32, 'inventory/icon3.png') dxDrawText ( 'Unelte', bX+300+70, bY+180, bX-300, bY-280, tocolor ( 255,255,255,175), 1, Button ) dxDrawRectangle (bX+300+70, bY+205, 106, 2, tocolor (255,255,255,175)) dxDrawImage ( bX+335+70, bY+210, 35, 31, 'inventory/icon6.png') dxDrawImage (bX+148+420, bY+320, 64, 64, "inventory/logo.png" ) --LOGO --Місце їжі xPos = 148 for i = 1, 6 do xPos = xPos+70 dxDrawRectangle (bX+xPos, bY+110, 64, 64, tocolor (132,132,132,75)) end yOff = 0 xPos = 148 local foodMax = 6 if foodMax > #foodInventory then foodMax = #foodInventory end for i = 1, foodMax do xPos = xPos+70 dxDrawImage ( bX+xPos, bY+110, 64, 64, 'icons/'..foodInventory[i][2] ) end xOff = 148 for i = 1,6 do xOff = xOff+70 dxDrawRectangle (bX+xOff, bY+250, 64, 64, tocolor (132,132,132,75)) end local toolMax = 6 if toolMax > #toolInventory then toolMax = #toolInventory end xOff = 148 for i = 1, toolMax do xOff = xOff+70 dxDrawImage ( bX+xOff, bY+250, 64, 64, 'icons/'..toolInventory[i][2] ) end xOff = 148 for i = 1,6 do xOff = xOff+70 dxDrawRectangle (bX+xOff, bY-30, 64, 64, tocolor (132,132,132,75)) end local speclMax = 6 if speclMax > #inventoryWeap.spec then speclMax = #inventoryWeap.spec end xOff = 148 for i = 1, speclMax do xOff = xOff+70 dxDrawImage ( bX+xOff, bY-30, 64, 64, 'icons/'..inventoryWeap.spec[i][2] ) end -------------------------------- --ОРУЖКА if selectedMainWeapon > 0 then dxDrawRectangle (bX+148+70, bY-310, 128, 64, tocolor (50,50,50,125))--Основна оружка [] dxDrawImage ( bX+148+70, bY-310, 128, 64, 'icons/'..inventoryWeap.main[selectedMainWeapon][2] ) dxDrawText(inventoryWeap.main[selectedMainWeapon][1],bX+148+75+128, bY+-310, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) end if selectedAdditWeapon > 0 then if inventoryWeap.addit[selectedAdditWeapon] then local sizeX = 128 local Name = 64 local offX = -32 if inventoryWeap.addit[selectedAdditWeapon][3]/inventoryWeap.addit[selectedAdditWeapon][4] == 1 then sizeX = 64 Name = 0 offX = 0 end dxDrawRectangle (bX+148+70, bY-240, sizeX, 64, tocolor (50,50,50,125)) dxDrawImage ( bX+148+70, bY-240, sizeX, 64, 'icons/'..inventoryWeap.addit[selectedAdditWeapon][2] ) dxDrawText(inventoryWeap.addit[selectedAdditWeapon][1],bX+288+Name, bY+-240, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) else selectedAdditWeapon = 0 end end local weapon3 = getElementData(getLocalPlayer(),"currentweapon_3") if weapon3 == "Binoclu" then dxDrawRectangle (bX+148+70, bY+-170, 64, 64, tocolor (50,50,50,125)) dxDrawImage ( bX+148+70, bY+-170, 64, 64, 'icons/13.union') dxDrawText(weapon3,bX+288, bY+-170, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) elseif weapon3 == "Grenadă M67" then dxDrawRectangle (bX+148+70, bY+-170, 64, 64, tocolor (50,50,50,125)) dxDrawImage ( bX+148+70, bY+-170, 64, 64, 'icons/85.union') dxDrawText(weapon3,bX+288, bY+-170, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) elseif weapon3 == "Fumigenă" then dxDrawRectangle (bX+148+70, bY+-170, 64, 64, tocolor (50,50,50,125)) dxDrawImage ( bX+148+70, bY+-170, 64, 64, 'icons/82.union') dxDrawText(weapon3,bX+288, bY+-170, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) elseif weapon3 == "Flashbang" then dxDrawRectangle (bX+148+70, bY+-170, 64, 64, tocolor (50,50,50,125)) dxDrawImage ( bX+148+70, bY+-170, 64, 64, 'icons/327.union') dxDrawText(weapon3,bX+288, bY+-170, bX+180, bY-250, tocolor(255,255,255,150), 1, Button) end if mainWeaponSelection then local yOff = 32 for i = 1, #inventoryWeap.main do yOff = yOff+32 dxDrawRectangle (bX+148+70, bY-310+yOff, 414-64, 35, tocolor ( 0,0,0,255 ) ) -- осн. оружие dxDrawText ( inventoryWeap.main[i][1], bX-180, bY-310+yOff, screenWidth, screenHeight, tocolor ( 255,255,255,150), 1, Button,"center") end end if additWeaponSelection then local yOff = 32 for i = 1, #inventoryWeap.addit do yOff = yOff+32 dxDrawRectangle (bX+148+70, bY-240+yOff, 414-64, 35, tocolor ( 0,0,0,255 ) ) dxDrawText ( inventoryWeap.addit[i][1], bX-180, bY-240+yOff, screenWidth, screenHeight, tocolor (255,255,255,150),1, Button,"center") end end --Конец оружия --МЕНЮ ЛУТА yOff = 0 local mainMax = 9 if mainMax > #inventory then mainMax = #inventory end for i = 1, mainMax do if inventory[i+itOff][2] == 0 and inventory[i+itOff][3] == 0 then inventory[i+itOff][2] = 1 end if inventory[i+itOff][5]/inventory[i+itOff][6] == 1 then offX = 64 else offX = 128 end if selectedItemLabel == i then dxDrawRectangle (bX-675, bY-315+yOff, 400, 64, tocolor ( 255, 10, 10, 50 ) ) end dxDrawImage ( bX-620, bY-315+yOff, offX, 64, 'icons/'..inventory[i+itOff][4] ) dxDrawText ( inventory[i+itOff][1], bX-600+offX, bY-292+yOff, screenWidth, screenHeight, tocolor ( 255,255,255,255), 1, fanbox ) if inventory[i+itOff][2] > 0 then dxDrawText ( inventory[i+itOff][2], bX-640, bY-292+yOff, screenWidth, screenHeight, tocolor ( 255,100,100,255), 1, fanbox ) end if inventory[i+itOff][3] > 0 then dxDrawText ( inventory[i+itOff][3], bX-320, bY-292+yOff, screenWidth, screenHeight, tocolor ( 255,255,255,255), 1, fanbox) end yOff = yOff+64 end -------------------------МЕНЮ ЛУТА end mainWeapSelectionLabels = {} additWeapSelectionLabels = {} function showWeaponSelect (button) if button.name == 'Inventory_1' then setElementData ( localPlayer, "Inventory_Setting",1) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_2' then setElementData ( localPlayer, "Inventory_Setting",2) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_3' then setElementData ( localPlayer, "Inventory_Setting",3) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_4' then setElementData ( localPlayer, "Inventory_Setting",4) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_5' then setElementData ( localPlayer, "Inventory_Setting",5) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_6' then setElementData ( localPlayer, "Inventory_Setting",6) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_7' then setElementData ( localPlayer, "Inventory_Setting",7) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_8' then setElementData ( localPlayer, "Inventory_Setting",8) placeItemsInInventory () itOff = 0 selectedItemLabel = 9 elseif button.name == 'Inventory_OLD' then setElementData ( localPlayer, "Inventory",0) placeItemsInInventory () closeInventory() elseif button.name == 'mainWeap' then if not mainWeaponSelection then stopAdditWeaponSelection () if #inventoryWeap.main > 1 or selectedMainWeapon == 0 then mainWeaponSelection = true yOff = 32 for i = 1, #inventoryWeap.main do yOff = yOff+32 local createdLabel = guiCreateLabel ( bX+148+70, bY-310+yOff, 414-64, 35, '', false ) setElementData ( createdLabel, 'mainWeapSelection', true ) setElementData ( createdLabel, 'id', i ) addEventHandler ( "onClientGUIClick", createdLabel, weapSelectionLabelClicked, false ) table.insert ( mainWeapSelectionLabels, createdLabel ) placeItemsInInventory () end end else stopMainWeaponSelection () end elseif button.name == 'secWeap' then if not additWeaponSelection then stopMainWeaponSelection () if #inventoryWeap.addit > 1 or selectedAdditWeapon == 0 then additWeaponSelection = true yOff = 32 for i = 1, #inventoryWeap.addit do yOff = yOff+32 local createdLabel = guiCreateLabel ( bX+148+70, bY-240+yOff, 414-64, 35, '', false ) setElementData ( createdLabel, 'additWeapSelection', true ) setElementData ( createdLabel, 'id', i ) addEventHandler ( "onClientGUIClick", createdLabel, weapSelectionLabelClicked, false ) table.insert ( additWeapSelectionLabels, createdLabel ) placeItemsInInventory () end end else stopAdditWeaponSelection() end elseif string.find(button.name, 'arrowRev' ) then if loot then stopAdditWeaponSelection () stopMainWeaponSelection () if inventory [selectedItemLabel+itOff][2] > 0 then moveItemInInventory () end end elseif string.find(button.name, 'arrow' ) then stopAdditWeaponSelection () stopMainWeaponSelection () if inventory [selectedItemLabel+itOff][3] > 0 then moveItemOutOfInventory ( inventory [selectedItemLabel+itOff][1] ) placeItemsInInventory () end end end addEvent ( "imageButtonClicked", true ) addEventHandler ( 'imageButtonClicked', root, showWeaponSelect) function checkItemPlus(itemName) local itemPlus = 1 if itemName == "M1911 Mag" then itemPlus = 7 elseif itemName == "M9 SD Mag" then itemPlus = 15 elseif itemName == ".45ACP" then itemPlus = 7 elseif itemName == "PDW Mag" then itemPlus = 30 elseif itemName == "MP5 SD" then itemPlus = 20 elseif itemName == "АК" then itemPlus = 30 elseif itemName == "STANAG SD" then itemPlus = 20 elseif itemName == "1866 Slug" then itemPlus = 7 elseif itemName == "2Rnd. Slug" then itemPlus = 2 elseif itemName == "M1014 Slug" then itemPlus = 7 elseif itemName == "M24" then itemPlus = 5 elseif itemName == "Lee Enfield Mag" then itemPlus = 10 elseif itemName == "M136 Rocket" then itemPlus = 0 end return itemPlus end moveItemInInventory = function() local itemName = inventory [selectedItemLabel+itOff][1] if isPlayerInLoot() then if getElementData(isPlayerInLoot(), itemName) and getElementData(isPlayerInLoot(), itemName) >= 1 then if not isToolbeltItem(itemName) then if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then if not playerMovedInInventory then triggerEvent("onPlayerMoveItemInInventory", getLocalPlayer(), itemName, isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end, 100, 1) else startRollMessage2("Inventory", "Nu te grăbi!", 255, 22, 0) return true end else startRollMessage2("Inventory", "Inventar plin!", 255, 22, 0) return true end else playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end, 100, 1) triggerEvent("onPlayerMoveItemInInventory", getLocalPlayer(), itemName, isPlayerInLoot()) end end end if isPlayerInLoot() then local col = getElementData(getLocalPlayer(), "currentCol") setTimer(placeItemsInInventory, 100, 1) end end function weapSelectionLabelClicked () if getElementData ( source, 'mainWeapSelection' ) then local id = getElementData ( source, 'id' ) local ammoData, weapID = getWeaponAmmoType(inventoryWeap.main[id][1]) if getElementData(localPlayer, ammoData) <= 0 then triggerEvent("displayClientInfo", getLocalPlayer(), "Arme", "Nu mai ai gloanțe!", 22, 255, 0) return true end mainWeaponSelection = false selectedMainWeapon = id triggerServerEvent("onPlayerRearmWeapon", getLocalPlayer(), inventoryWeap.main[id][1], 1) for i, label in ipairs(mainWeapSelectionLabels) do if isElement ( label ) then destroyElement ( label ) end end elseif getElementData ( source, 'additWeapSelection' ) then local id = getElementData ( source, 'id' ) local ammoData, weapID = getWeaponAmmoType(inventoryWeap.addit[id][1]) if getElementData(localPlayer, ammoData) <= 0 then triggerEvent("displayClientInfo", getLocalPlayer(), "Arme", "Nu mai ai gloanțe!", 22, 255, 0) return true end additWeaponSelection = false selectedAdditWeapon = id triggerServerEvent("onPlayerRearmWeapon", getLocalPlayer(), inventoryWeap.addit[id][1], 2) for i, label in ipairs(additWeapSelectionLabels) do if isElement ( label ) then destroyElement ( label ) end end end end bindKey("J", "down", initInventory) function isThereSomeoneInLoot () local loot = isPlayerInLoot() local playersTable = getElementsWithinColShape ( loot, 'player' ) for i, player in ipairs ( playersTable ) do if player ~= localPlayer then return true end end if not playersTable then return true end return false end showChat ( true )
  6. v36u

    Hide-Show Chat

    Hey guys, i am working on a dayz server, and im trying to hide the chat while the player has the inventory opened , and show it when he does not have the inventory open. Some help please? I know about showChat ( false ) or showChat ( true ) but i dont really know where to place them, i mean, i made something half right, when the player opens the inventory, the chat is hidden, when he closes the inventory , the chat is still hidden. Some help? Thanks in advance ^^
  7. Hello, its me again, with the same server but different problem. Now the server is hosted and i implemented a 'vip-points system' with a vip points shop, to stimulate players to donate on my server ( so i can host it longer ) . And on every donation the player gets an amount of VP. There is a problem. If the player disconnect or reconnects the points dissapear and the same thing with a server restart. Here are the codes : server side : local tabPanel = {} local buttons = {} local labels = {} local key = "F5" - local Tab = "::" local Tab1 = ".::" local Tab2 = "::." local player = localPlayer GUIEditor_Tab = {} function shopInterface() shop_window = guiCreateWindow(260,80, 850, 640, "VP SHOP [ "..key.." ]", false) bg = guiCreateStaticImage(1,20,850,610,"Logo/logo.png", false,shop_window) guiSetAlpha(bg,1) guiSetProperty(bg,"Disabled","true") guiSetVisible(shop_window, false) guiSetAlpha(shop_window, 0.73) guiWindowSetSizable(shop_window, false) exports.guicols:guiSetColor (shop_window, "green") tabPanel.myTabPanel = guiCreateTabPanel(35, 150, 780, 440, false, shop_window) tabPanel.Offers = guiCreateTab(""..Tab1.." First page "..Tab.."", tabPanel.myTabPanel) guiCreateStaticImage(1,1,778,410,"Logo/Offers.png", false,tabPanel.Offers ) -------------------------------------------------------------[ Weapon ]----------------------------------------------------------- tabPanel.Weap = guiCreateTab(""..Tab.." Weapons "..Tab.."", tabPanel.myTabPanel) buttons.weapon_sniper = guiCreateButton(1, 106, 190, 30, "KVSK \n 75 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_sniper , "default-bold-small") guiCreateStaticImage(1,1,189,105,"Weap/sniper.png", false,tabPanel.Weap ) buttons.weapon_m4 = guiCreateButton(198, 106, 190, 30, "M4A1 Holo \n 50 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_m4 , "default-bold-small") guiCreateStaticImage(198,1,189,105,"Weap/m4.png", false,tabPanel.Weap ) buttons.weapon_ak = guiCreateButton(395, 106, 190, 30, "AKM GP-25 \n 50 VP", false,tabPanel.Weap) guiSetFont(buttons.weapon_ak , "default-bold-small") guiCreateStaticImage(395,1,189,105,"Weap/ak.png", false,tabPanel.Weap ) buttons.weapon_lee = guiCreateButton(590, 106, 190, 30, "JNG-90 \n 35 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_lee , "default-bold-small") guiCreateStaticImage(590,1,189,105,"Weap/lee.png", false,tabPanel.Weap ) buttons.weapon_spaz = guiCreateButton(1, 246, 190, 30, "SPAZ-12 Combat Shotgun \n 20 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_spaz , "default-bold-small") guiCreateStaticImage(1,140,189,105,"Weap/spaz.png", false,tabPanel.Weap ) buttons.weapon_sawn = guiCreateButton(200, 246, 190, 30, "Sawn-Off Shotgun \n 15 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_sawn , "default-bold-small") guiCreateStaticImage(200,140,189,105,"Weap/sawn.png", false,tabPanel.Weap ) buttons.weapon_winchester = guiCreateButton(395, 246, 190, 30, "Benelli M3 \n 20 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_winchester , "default-bold-small") guiCreateStaticImage(395,140,189,105,"Weap/winchester.png", false,tabPanel.Weap ) buttons.weapon_uzi = guiCreateButton(590, 246, 190, 30, "PDW \n 20 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_uzi , "default-bold-small") guiCreateStaticImage(590,140,189,105,"Weap/uzi.png", false,tabPanel.Weap ) buttons.weapon_mp5 = guiCreateButton(1, 386, 190, 30, "MP5A5 \n 25 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_mp5 , "default-bold-small") guiCreateStaticImage(1,280,189,105,"Weap/mp5.png", false,tabPanel.Weap ) buttons.weapon_desert = guiCreateButton(200, 386, 190, 30, "Desert Deagle \n 30 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_desert , "default-bold-small") guiCreateStaticImage(200,280,189,105,"Weap/desert.png", false,tabPanel.Weap ) buttons.weapon_m1911 = guiCreateButton(395, 386, 190, 30, "G17 \n 10 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_m1911 , "default-bold-small") guiCreateStaticImage(395,280,189,105,"Weap/1911.png", false,tabPanel.Weap ) buttons.weapon_m9 = guiCreateButton(590, 386, 190, 30, "M9 SD \n 10 VP", false, tabPanel.Weap) guiSetFont(buttons.weapon_m9 , "default-bold-small") guiCreateStaticImage(590,280,189,105,"Weap/m9.png", false,tabPanel.Weap ) ------------------------------------------------------------------[ Ammo ]---------------------------------------------------------------- tabPanel.Ammo = guiCreateTab(""..Tab.." Ammo "..Tab.."", tabPanel.myTabPanel) buttons.snipermag = guiCreateButton(1, 106, 190, 30,"KVSK / 30 Mag \n 20 VP", false, tabPanel.Ammo) guiSetFont(buttons.snipermag , "default-bold-small") guiCreateStaticImage(1,1,189,105,"Ammo/sniper.png", false,tabPanel.Ammo ) buttons.m4mag = guiCreateButton(198, 106, 190, 30, "M4A1 Holo / 120 Mag \n 15 VP", false, tabPanel.Ammo) guiSetFont(buttons.m4mag , "default-bold-small") guiCreateStaticImage(198,1,189,105,"Ammo/m4.png", false,tabPanel.Ammo ) buttons.akmag = guiCreateButton(395, 106, 190, 30, "AKM GP-25 / 120 Mag \n 15 VP", false,tabPanel.Ammo) guiSetFont(buttons.akmag , "default-bold-small") guiCreateStaticImage(395,1,189,105,"Ammo/ak.png", false,tabPanel.Ammo ) buttons.leemag = guiCreateButton(590, 106, 190, 30, "JNG-90 / 30 Mag \n 10 VP", false, tabPanel.Ammo) guiSetFont(buttons.leemag , "default-bold-small") guiCreateStaticImage(590,1,189,105,"Ammo/lee.png", false,tabPanel.Ammo ) buttons.spazmag = guiCreateButton(1, 246, 190, 30, "SPAZ-12 / 28 Mag \n 8 VP", false, tabPanel.Ammo) guiSetFont(buttons.spazmag , "default-bold-small") guiCreateStaticImage(1,140,189,105,"Ammo/12gauge.png", false,tabPanel.Ammo ) buttons.sawnmag = guiCreateButton(200, 246, 190, 30, "Sawn-Off Shotgun / 30 Mag \n 6 VP", false, tabPanel.Ammo) guiSetFont(buttons.sawnmag , "default-bold-small") guiCreateStaticImage(200,140,189,105,"Ammo/sawn.png", false,tabPanel.Ammo ) buttons.winchestermag = guiCreateButton(395, 246, 190, 30, "Benelli M3 / 30 Mag \n 8 VP", false, tabPanel.Ammo) guiSetFont(buttons.winchestermag , "default-bold-small") guiCreateStaticImage(395,140,189,105,"Ammo/12gauge.png", false,tabPanel.Ammo ) buttons.uzimag = guiCreateButton(590, 246, 190, 30, "PDW / 200 Mag \n 5 VP", false, tabPanel.Ammo) guiSetFont(buttons.uzimag , "default-bold-small") guiCreateStaticImage(590,140,189,105,"Ammo/uzi.png", false,tabPanel.Ammo ) buttons.mp5mag = guiCreateButton(1, 386, 190, 30, "MP5A5 / 120 Mag \n 5 VP", false, tabPanel.Ammo) guiSetFont(buttons.weapon_mp5mag , "default-bold-small") guiCreateStaticImage(1,280,189,105,"Ammo/mp5.png", false,tabPanel.Ammo ) buttons.desertmag = guiCreateButton(200, 386, 190, 30, "Desert Deagle / 30 Mag \n 5 VP", false, tabPanel.Ammo) guiSetFont(buttons.weapon_desertmag , "default-bold-small") guiCreateStaticImage(200,280,189,105,"Ammo/desert.png", false,tabPanel.Ammo ) buttons.m1911mag = guiCreateButton(395, 386, 190, 30, "G17 / 68 Mag \n 5 VP", false, tabPanel.Ammo) guiSetFont(buttons.weapon_m1911mag , "default-bold-small") guiCreateStaticImage(395,280,189,105,"Ammo/m1911.png", false,tabPanel.Ammo ) buttons.m9mag = guiCreateButton(590, 386, 190, 30, "M9 SD / 68 Mag \n 5 VP", false, tabPanel.Ammo) guiSetFont(buttons.m9mag , "default-bold-small") guiCreateStaticImage(590,280,189,105,"Ammo/m9.png", false,tabPanel.Ammo ) --------------------------------------------------------------------[ Food ]--------------------------------------------------------------------- tabPanel.Food = guiCreateTab(""..Tab.." Food "..Tab.."", tabPanel.myTabPanel) buttons.Pizza = guiCreateButton(1, 106, 190, 30, "Pizza / 5 pieces \n 25 VP ", false, tabPanel.Food) guiSetFont(buttons.Pizza , "default-bold-small") guiCreateStaticImage(1,1,189,105, "Food/pizza.png", false,tabPanel.Food ) buttons.Milk = guiCreateButton(198, 106, 190, 30, "Milk / 5 pieces \n 25 VP", false, tabPanel.Food) guiSetFont(buttons.Milk , "default-bold-small") guiCreateStaticImage(198,1,189,105, "Food/milk.png", false,tabPanel.Food ) buttons.Cooked = guiCreateButton(395, 106, 190, 30, "Cooked Meat / 5 pieces \n 25 VP", false,tabPanel.Food) guiSetFont(buttons.Cooked , "default-bold-small") guiCreateStaticImage(395,1,189,105,"Food/ham.png", false,tabPanel.Food ) buttons.Soda = guiCreateButton(590, 106, 190, 30, "Soda Bottle / 5 pieces \n 25 VP", false, tabPanel.Food) guiSetFont(buttons.Soda , "default-bold-small") guiCreateStaticImage(590,1,189,105,"Food/cola.png", false,tabPanel.Food ) buttons.PastaCan = guiCreateButton(1, 246, 190, 30, "Pasta Can / 5 pieces \n 25 VP", false, tabPanel.Food) guiSetFont(buttons.PastaCan , "default-bold-small") guiCreateStaticImage(1,140,189,105,"Food/pasta.png", false,tabPanel.Food ) buttons.WaterBottle = guiCreateButton(200, 246, 190, 30, "Canteen / 5 pieces \n 25 VP", false, tabPanel.Food) guiSetFont(buttons.WaterBottle , "default-bold-small") guiCreateStaticImage(200,140,189,105,"Food/water.png", false,tabPanel.Food ) buttons.BeansCan = guiCreateButton(395, 246, 190, 30, "Beans Can / 5 pieces \n 25 VP", false, tabPanel.Food) guiSetFont(buttons.BeansCan , "default-bold-small") guiCreateStaticImage(395,140,189,105,"Food/beans.png", false,tabPanel.Food ) buttons.food = guiCreateButton(1, 386, 190, 30, "Food / Full \n 10 VP", false, tabPanel.Food) guiSetFont(buttons.food , "default-bold-small") guiCreateStaticImage(1,280,189,105,"Food/food.png", false,tabPanel.Food ) buttons.thirst = guiCreateButton(200, 386, 190, 30, "Thirst / Full \n 10 VP", false, tabPanel.Food) guiSetFont(buttons.thirst , "default-bold-small") guiCreateStaticImage(200,280,189,105,"Food/thirst.png", false,tabPanel.Food ) -----------------------------------------------------------[ Equipment ]------------------------------------------------------------------------ tabPanel.Equipment = guiCreateTab(""..Tab.." Equipment "..Tab.."", tabPanel.myTabPanel) buttons.small = guiCreateButton(1, 106, 190, 30, "Drybag Backpack / 40 slots \n 15 VP", false, tabPanel.Equipment) --1 guiCreateStaticImage(1,1,189,105, "Equipment/small-Backpack.png", false,tabPanel.Equipment ) guiSetFont(buttons.small , "default-bold-small") buttons.alice = guiCreateButton(198, 106, 190, 30, "Mountain Backpack / 70 slots \n 25 VP", false, tabPanel.Equipment) --2 guiCreateStaticImage(198,1,189,105, "Equipment/Alice-pack.png", false,tabPanel.Equipment ) guiSetFont(buttons.alice , "default-bold-small") buttons.czech = guiCreateButton(395, 106, 190, 30, "Large Backpack / 90 sloys \n 40 VP", false, tabPanel.Equipment) --3 guiCreateStaticImage(395,1,189,105, "Equipment/Czech-Backpack.png", false,tabPanel.Equipment ) guiSetFont(buttons.czech , "default-bold-small") buttons.coyote = guiCreateButton(590, 106, 190, 30, "Dark Backpack / 100 slots \n 45 VP", false, tabPanel.Equipment) --4 guiCreateStaticImage(590,1,189,105, "Equipment/Coyote-Backpack.png", false,tabPanel.Equipment) guiSetFont(buttons.coyote , "default-bold-small") buttons.night = guiCreateButton(1, 246, 190, 30, "Night Vision Goggles \n 5 VP", false, tabPanel.Equipment) --5 guiCreateStaticImage(1,140,189,105,"Equipment/nvg.png", false,tabPanel.Equipment ) guiSetFont(buttons.night , "default-bold-small") buttons.infa = guiCreateButton(200, 246, 190, 30, "Infrared Goggles \n 10 VP", false, tabPanel.Equipment) --6 guiCreateStaticImage(200,140,189,105, "Equipment/infa.png", false,tabPanel.Equipment ) guiSetFont(buttons.infa , "default-bold-small") buttons.Binoculars = guiCreateButton(395, 246, 190, 30, "Binoculars \n 5 VP", false, tabPanel.Equipment) --7 guiSetFont(buttons.Binoculars , "default-bold-small") guiCreateStaticImage(395,140,189,105,"Equipment/binoculars.png", false,tabPanel.Equipment ) buttons.tent = guiCreateButton(590, 246, 190, 30, "Tent \n 15 VP", false, tabPanel.Equipment) --8 guiSetFont(buttons.tent , "default-bold-small") guiCreateStaticImage(590,140,189,105,"Equipment/tent.png", false,tabPanel.Equipment ) buttons.MAXSlots = guiCreateButton(1, 386, 190, 30, "MAX_Slots 175 \n 65 VP", false, tabPanel.Equipment) --9 guiSetFont(buttons.MAXSlots , "default-bold-small") guiCreateStaticImage(1,280,189,105,"Equipment/MAXSlots.png", false,tabPanel.Equipment ) buttons.Watch = guiCreateButton(200, 386, 190, 30, "Watch \n 1 VP", false, tabPanel.Equipment) --10 guiSetFont(buttons.Watch , "default-bold-small") guiCreateStaticImage(200,280,189,105,"Equipment/Watch.png", false,tabPanel.Equipment ) buttons.gps = guiCreateButton(395, 386, 190, 30, "GPS \n 1 VP", false, tabPanel.Equipment) --11 guiSetFont(buttons.gps , "default-bold-small") guiCreateStaticImage(395,280,189,105,"Equipment/gps.png", false,tabPanel.Equipment ) buttons.map = guiCreateButton(590, 386, 190, 30, "Map \n 1 VP", false, tabPanel.Equipment) --12 guiSetFont(buttons.map , "default-bold-small") guiCreateStaticImage(590,280,189,105,"Equipment/map.png", false,tabPanel.Equipment ) -----------------------------------------------------------------------[ Other ]-------------------------------------------------------------------------------------- tabPanel.Other = guiCreateTab(""..Tab.." Medical "..Tab.."", tabPanel.myTabPanel) buttons.Bandage = guiCreateButton(1, 106, 190, 30, "Bandage +2 \n 5 VP", false, tabPanel.Other) --1 guiCreateStaticImage(1,1,189,105, "Other/bandage.png", false,tabPanel.Other ) guiSetFont( buttons.Bandage, "default-bold-small") buttons.Painkiller= guiCreateButton(198, 106, 190, 30, "Painkiller +2 \n 5 VP", false, tabPanel.Other) --2 guiCreateStaticImage(198,1,189,105, "Other/painkiller.png", false,tabPanel.Other ) guiSetFont(buttons.Painkiller, "default-bold-small") buttons.MedicKit = guiCreateButton(395, 106, 190, 30, "Medic Supplies +2 \n 10 VP", false,tabPanel.Other) --3 guiCreateStaticImage(395,1,189,105, "Other/medic-kit.png", false,tabPanel.Other ) guiSetFont(buttons.MedicKit , "default-bold-small") buttons.Morphine = guiCreateButton(590, 106, 190, 30, "Morphine +2 \n 5 VP", false, tabPanel.Other) --4 guiCreateStaticImage(590,1,189,105, "Other/morphine.png", false,tabPanel.Other ) guiSetFont( buttons.Morphine, "default-bold-small") buttons.BloodBag = guiCreateButton(1, 246, 190, 30, "Blood Bag +2 \n 5 VP", false, tabPanel.Other) --5 guiCreateStaticImage(1,140,189,105,"Other/BloodBag.png", false,tabPanel.Other ) guiSetFont(buttons.BloodBag, "default-bold-small") buttons.blood = guiCreateButton(200, 246, 190, 30, "Blood + 1000 \n 10 VP", false, tabPanel.Other) --6 guiSetFont(buttons.blood , "default-bold-small") guiCreateStaticImage(200,140,189,105, "Other/blood.png", false,tabPanel.Other ) buttons.blood2 = guiCreateButton(395, 246, 190, 30, "Blood + 2500 \n 20 VP", false, tabPanel.Other) --7 guiSetFont(buttons.blood2 , "default-bold-small") guiCreateStaticImage(395,140,189,105,"Other/blood2.png", false,tabPanel.Other ) buttons.blood3 = guiCreateButton(590, 246, 190, 30, "Blood + 4000 \n 30 VP", false, tabPanel.Other) --8 guiSetFont(buttons.blood3 , "default-bold-small") guiCreateStaticImage(590,140,189,105,"Other/blood3.png", false,tabPanel.Other ) ---------------------------------------------------------------[ Skins ]------------------------------------------------------------------------------------------------ tabPanel.Skins = guiCreateTab(""..Tab.." Skins "..Tab2.."", tabPanel.myTabPanel) buttons.Ghillie = guiCreateButton(1, 106, 190, 30, "Ghillie Suit Ghost \n 10 VP", false, tabPanel.Skins) guiCreateStaticImage(1,1,189,105, "Skins/ghillie.png", false,tabPanel.Skins ) guiSetFont(buttons.Ghillie, "default-bold-small") buttons.Camouflage = guiCreateButton(198, 106, 190, 30, "Ghillie Suit 1 \n 5 VP", false, tabPanel.Skins) guiCreateStaticImage(198,1,189,105, "Skins/ghillie.png", false,tabPanel.Skins ) guiSetFont(buttons.Camouflage, "default-bold-small") buttons.Civilian = guiCreateButton(395, 106, 190, 30, "Ghillie Suit 2 \n 5 VP", false, tabPanel.Skins) guiCreateStaticImage(395,1,189,105, "Skins/ghillie.png", false,tabPanel.Skins ) guiSetFont(buttons.Civilian, "default-bold-small") buttons.Civilian2 = guiCreateButton(590, 106, 190, 30, "Ghillie Suit 3 \n 5 VP", false, tabPanel.Skins) guiCreateStaticImage(590,1,189,105, "Skins/ghillie.png", false,tabPanel.Skins ) guiSetFont(buttons.Civilian, "default-bold-small") -------------------------------------------------------[ Close ]------------------------------------------------------------------------ buttons.Sair = guiCreateButton(35, 600, 780, 30, "Close", false, shop_window) guiSetFont(buttons.Sair , "default-bold-small") -----------------------------------------------[ Button Color ]---------------------------------------------------------------- for _, button in pairs(buttons) do guiSetProperty(button, "HoverTextColour", "FFFF0000") end end addEventHandler("onClientResourceStart", resourceRoot, shopInterface) -----------------------------------------------[ Weapon ]----------------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_sniper) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_sniper") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_m4) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_m4") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_ak) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_ak") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_lee) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_lee") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_spaz) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_spaz") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_sawn) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_sawn") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_winchester) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_winchester") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_uzi) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_uzi") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_mp5) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_mp5") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_desert) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_desert") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_m1911) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_m1911") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.weapon_m9) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_m9") end end ) ----------------------------------------------------------[ Ammo ]----------------------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.snipermag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "snipermag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.m4mag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "m4mag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.akmag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "akmag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.leemag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "leemag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.spazmag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "spazmag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.sawnmag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "sawnmag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.winchestermag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "winchestermag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.uzimag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "uzimag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.mp5mag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "mp5mag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.desertmag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "desertmag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.m1911mag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "m1911mag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.m9mag) then triggerServerEvent("onClientBuyAmmo", localPlayer, "m9mag") end end ) ----------------------------------------------------------------[ Food ] --------------------------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Pizza) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_Pizza") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Milk) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_Milk") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Cooked) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_Cooked") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Soda) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_Soda") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.PastaCan) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_PastaCan") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.WaterBottle) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_WaterBottle") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.BeansCan) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_BeansCan") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.food) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_food") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.thirst) then triggerServerEvent("onClientBuyComida", localPlayer, "Comida_thirst") end end ) ---------------------------------------------------------------[ Equipment ]----------------------------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.small) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_small") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.alice) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_alice") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.czech) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_czech") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.coyote) then triggerServerEvent("onClientBuyArm", localPlayer, "Arm_coyote") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.night) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_night") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.infa) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_infa") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Binoculars) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_Binoculars") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.tent) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_tent") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.MAXSlots) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_MAXSlots") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Watch) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_Watch") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.gps) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_gps") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.map) then triggerServerEvent("onClientBuyArm", localPlayer, "Arms_map") end end ) -------------------------------------------------------[ Skins ] ----------------------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Ghillie) then triggerServerEvent("onClientBuySkin", localPlayer, "Skin_Ghillie") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Camouflage) then triggerServerEvent("onClientBuySkin", localPlayer, "Skin_Camouflage") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Civilian) then triggerServerEvent("onClientBuySkin", localPlayer, "Skin_Civilian") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Civilian2) then triggerServerEvent("onClientBuySkin", localPlayer, "Skin_Civilian2") end end ) ----------------------------------------------------[[ Other ]]------------------------------------------------------------------ addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Bandage) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_Bandage") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Painkiller) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_PainKiller") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.MedicKit) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_MedicKit") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Morphine) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_Morphine") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.BloodBag) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_BloodBag") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.blood) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_blood") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.blood2) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_blood2") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.blood3) then triggerServerEvent("onClientBuyMedico", localPlayer, "Medico_blood3") end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == buttons.Sair) then guiSetVisible(shop_window,false) showCursor(false) end end ) function ShowGUI ( ) guiSetVisible ( shop_window, not guiGetVisible ( shop_window ) ) showCursor ( not isCursorShowing( ) ) end bindKey ( key,"down", ShowGUI ) client side : function BuyWeaponOnServer(weapon_name,data,value) player_money = getPlayerMoney(source) if(weapon_name == "weapon_sniper") then if ( player_money >= 75) then setElementData(source,"KVSK",getElementData(source,"KVSK") + 1) -- 1 takePlayerMoney(source, 75) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a KVSK !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_m4") then if ( player_money >= 50) then setElementData(source,"M4A1 Holo",getElementData(source,"M4A1 Holo") + 1) -- 2 takePlayerMoney(source, 50) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a M4A1 Holo !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_ak") then if ( player_money >= 50) then setElementData(source,"AKM GP-25",getElementData(source,"AKM GP-25") + 1) -- 3 takePlayerMoney(source, 50) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought an AKM GP-25 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_lee") then if ( player_money >= 35) then setElementData(source, "JNG-90",getElementData(source,"JNG-90") + 1) -- 4 takePlayerMoney(source, 35) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a JNG-90 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_spaz") then if ( player_money >= 20) then setElementData(source, "SPAZ-12",getElementData(source,"SPAZ-12") + 1) -- 5 takePlayerMoney(source, 20) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a SPAZ-12 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_sawn") then if ( player_money >= 15) then setElementData(source, "Sawn-Off Shotgun",getElementData(source,"Sawn-Off Shotgun") + 1) -- 6 takePlayerMoney(source, 15) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Sawn-Off Shotgun !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_winchester") then if ( player_money >= 20) then setElementData(source, "Benelli M3",getElementData(source,"Benelli M3") + 1) -- 7 takePlayerMoney(source, 20) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Benelli M3 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_uzi") then if ( player_money >= 20) then setElementData(source, "PDW",getElementData(source,"PDW") + 1) -- 8 takePlayerMoney(source, 20) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a PDW !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_mp5") then if ( player_money >= 25) then setElementData(source,"MP5A5",getElementData(source,"MP5A5") + 1) -- 9 takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a MP5A5 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_desert") then if ( player_money >= 30) then setElementData(source,"Desert Deagle",getElementData(source,"Desert Deagle") + 1) -- 10 takePlayerMoney(source, 30) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Desert Deagle !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_m1911") then if ( player_money >= 10) then setElementData(source,"G17",getElementData(source,"G17") + 1) -- 11 takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a G17 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(weapon_name == "weapon_m9") then if ( player_money >= 10) then setElementData(source,"M9 SD",getElementData(source,"M9 SD") + 1) -- 12 takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a M9 SD !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end end addEvent("onClientBuyWeapon", true) addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer) -------------------------------------------------------[ Ammo ] ------------------------------------------------------------ function BuyWeaponOnServer(Ammo_name,data,value) player_money = getPlayerMoney(source) if(Ammo_name == "snipermag") then if ( player_money >= 20) then setElementData(source,"KVSK Mag",getElementData(source,"KVSK Mag") + 30) takePlayerMoney(source, 20) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 30 KVSK Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "m4mag") then if ( player_money >= 15) then setElementData(source,"M4A1 Holo Mag",getElementData(source,"M4A1 Holo Mag") + 120) takePlayerMoney(source, 15) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 120 M4A1 Holo Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "akmag") then if ( player_money >= 15) then setElementData(source,"AKM GP-25 Mag",getElementData(source,"AKM GP-25 Mag") + 120) takePlayerMoney(source, 15) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 120 AKM GP-25 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "leemag") then if ( player_money >= 10) then setElementData(source, "JNG-90 Mag",getElementData(source,"JNG-90 Mag") + 30) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 30 JNG-90 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "spazmag") then if ( player_money >= 8) then setElementData(source, "SPAZ-12 Mag",getElementData(source,"SPAZ-12 Mag") + 28) takePlayerMoney(source, 8) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 28 SPAZ-12 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "sawnmag") then if ( player_money >= 6) then setElementData(source, "2Rnd. Slug",getElementData(source,"2Rnd. Slug") + 30) takePlayerMoney(source, 6) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 30 Sawn-Off Shotgun Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "winchestermag") then if ( player_money >= 500) then setElementData(source, "Benelli M3 Mag",getElementData(source,"Benelli M3 Mag") + 30) -- 7 takePlayerMoney(source, 500) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 30 Benelli M3 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "uzimag") then if ( player_money >= 5) then setElementData(source, "PDW Mag",getElementData(source,"PDW Mag") + 200) -- 8 takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 200 PDW Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "mp5mag") then if ( player_money >= 5) then setElementData(source,"MP5A5 Mag",getElementData(source,"MP5A5 Mag") + 120) -- 9 takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 120 MP5A5 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "desertmag") then if ( player_money >= 5) then setElementData(source,"Desert Deagle Mag",getElementData(source,"Desert Deagle Mag") + 30) -- 10 takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 30 Desert Deagle Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "m1911mag") then if ( player_money >= 5) then setElementData(source,"G17 Mag",getElementData(source,"G17 Mag") + 68) -- 11 takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 68 G17 Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Ammo_name == "m9mag") then if ( player_money >= 5) then setElementData(source,"M9 SD Mag",getElementData(source,"M9 SD Mag") + 68) -- 12 takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 68 M9 SD Mag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end end addEvent("onClientBuyAmmo", true) addEventHandler("onClientBuyAmmo", getRootElement(), BuyWeaponOnServer) --------------------------------------------------------------------------------[ Food ] ------------------------------------------------------------------------------ function BuyWeaponOnServer(food_name,data,value) player_money = getPlayerMoney(source) if(food_name == "Comida_Pizza") then if ( player_money >= 25) then setElementData(source, "Pizza",getElementData(source,"Pizza") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Pizza !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_Milk") then if ( player_money >= 25) then setElementData(source, "Milk",getElementData(source,"Milk") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Milk !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_Cooked") then if ( player_money >= 25) then setElementData(source, "Cooked Meat",getElementData(source,"Cooked Meat") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Cooked Meat !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_Soda") then if ( player_money >= 25) then setElementData(source, "Soda Bottle",getElementData(source,"Soda Bottle") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Soda Bottle !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_PastaCan") then if ( player_money >= 25) then setElementData(source, "Pasta Can",getElementData(source,"Pasta Can") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Pasta Can !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_WaterBottle") then if ( player_money >= 25) then setElementData(source, "Canteen",getElementData(source,"Canteen") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Canteen !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_BeansCan") then if ( player_money >= 25) then setElementData(source, "Beans Can",getElementData(source,"Beans Can") + 5) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 5 Beans Can !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_food") then if ( player_money >= 10) then setElementData(source, "food",100 ) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully refilled your hunger !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(food_name == "Comida_thirst") then if ( player_money >= 10) then setElementData(source, "thirst",100 ) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully refilled your thirst !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end end addEvent("onClientBuyComida", true) addEventHandler("onClientBuyComida", getRootElement(), BuyWeaponOnServer) ---------------------------------------------------------------[ Pouch ]----------------------------------------------------------------- function BuyWeaponOnServer(Arm_name,data,value) player_money = getPlayerMoney(source) if(Arm_name == "Arms_small") then if ( player_money >= 15) then setElementData(source, "Drybag Backpack (Black)",1 ) takePlayerMoney(source, 15) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Drybag Backpack (Black) !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_alice") then if ( player_money >= 25) then setElementData(source, "Mountain Backpack (Blue)",1 ) takePlayerMoney(source, 25) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Mountain Backpack (Blue)! ", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points!", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_czech") then if ( player_money >= 40) then setElementData(source, "Large Backpack",1 ) takePlayerMoney(source, 40) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Large Backpack !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arm_coyote") then if ( player_money >= 45) then setElementData(source, "Black Backpack",1 ) takePlayerMoney(source, 45) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Black Backpack !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_night") then if ( player_money >= 5) then setElementData(source, "Night vision goggles",getElementData(source,"Night vision goggles") + 1) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought Night Vision Googles !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_infa") then if ( player_money >= 10) then setElementData(source, "Infrared glasses",getElementData(source,"Infrared glasses") + 1) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought Infrared glasses !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_Binoculars") then if ( player_money >= 5) then setElementData(source, "Binoculars",getElementData(source,"Binoculars") + 1 ) takePlayerMoney(source, 5 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought Binoculars !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_tent") then if ( player_money >= 15) then setElementData(source, "Tent",getElementData(source,"Tent") + 1 ) takePlayerMoney(source, 15 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Tent !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_MAXSlots") then if ( player_money >= 65) then setElementData(source, "MAX_Slots",getElementData(source,"MAX_Slots") + 175 ) -- setElementData(source, "MAX_Slots",100 ) -- = ไม่สามารถชื้อช้ำได้ takePlayerMoney(source, 65 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully added 175 slots tp your inventory !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_Watch") then if ( player_money >= 1) then setElementData(source, "Watch",getElementData(source,"Watch") + 1 ) takePlayerMoney(source, 1 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a Watch !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_gps") then if ( player_money >= 1) then setElementData(source, "GPS",getElementData(source,"GPS") + 1 ) takePlayerMoney(source, 1 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a GPS !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(Arm_name == "Arms_map") then if ( player_money >= 1) then setElementData(source, "Map",getElementData(source,"Map") + 1 ) takePlayerMoney(source, 1 ) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought a GPS !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end end addEvent("onClientBuyArm", true) addEventHandler("onClientBuyArm", getRootElement(), BuyWeaponOnServer) ----------------------------------------------------------------------------------------------[ Other ]--------------------------------------------------------------------------------------------- function BuyWeaponOnServer(medico_name,data,value) player_money = getPlayerMoney(source) if(medico_name == "Medico_Bandage") then if ( player_money >= 5) then setElementData(source, "Bandage",getElementData(source,"Bandage") + 2) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 2 Bandages !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_PainKiller") then if ( player_money >= 5) then setElementData(source, "Painkiller",getElementData(source,"Painkiller") + 2) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 2 Painkillers !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_MedicKit") then if ( player_money >= 10) then setElementData(source, "Medical Supplies",getElementData(source,"Medical Supplies") + 2) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 2 Medical Supplies !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_Morphine") then if (player_money >= 5) then setElementData(source, "Morphine",getElementData(source,"Morphine") + 2) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 2 Morhine !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_BloodBag") then if (player_money >= 5) then setElementData(source, "Blood Bag",getElementData(source,"Blood Bag") + 2) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 2 Blood Bag !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_blood") then if (player_money >= 10) then setElementData(source, "blood",getElementData(source,"blood") + 1000) -- setElementData(source, "blood",getElementData(source,"blood") + 120) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully added 1000 blood to your health !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_blood2") then if (player_money >= 20) then setElementData(source, "blood",getElementData(source,"blood") + 2500) -- setElementData(source, "blood",getElementData(source,"blood") + 150) takePlayerMoney(source, 20) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully added 2500 blood to your health !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(medico_name == "Medico_blood3") then if (player_money >= 30) then setElementData(source, "blood",getElementData(source,"blood") + 4000) -- setElementData(source, "blood",getElementData(source,"blood") + 200) takePlayerMoney(source, 30) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully added 4000 blood to your health !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end end addEvent("onClientBuyMedico", true) addEventHandler("onClientBuyMedico", getRootElement(), BuyWeaponOnServer) -------------------------------------------------------[ Skins ] ----------------------------------------------------------- function BuyWeaponOnServer(skins_name,data,value) player_money = getPlayerMoney(source) if(skins_name == "Skin_Ghillie") then if ( player_money >= 10) then setElementData(source, "Ghillie Suit Ghost",getElementData(source,"Ghillie Suit Ghost") + 1) takePlayerMoney(source, 10) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 1 Ghillie Suit Ghost !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(skins_name == "Skin_Camouflage") then if ( player_money >= 5) then setElementData(source, "Ghillie Suit 1",getElementData(source,"Ghillie Suit 1") + 1) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 1 Ghillie Suit 1 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) end end if(skins_name == "Skin_Civilian") then if ( player_money >= 5) then setElementData(source, "Ghillie Suit 2",getElementData(source,"Ghillie Suit 2") + 1) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 1 Ghillie Suit 2 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) -- end end if(skins_name == "Skin_Civilian2") then if ( player_money >= 5) then setElementData(source, "Ghillie Suit 3",getElementData(source,"Ghillie Suit 3") + 1) takePlayerMoney(source, 5) outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You succesfully bought 1 Ghillie Suit 3 !", source, 255, 255, 255 , true) else outputChatBox("#6495ED[DayzLife Romania Shop] #C0C0C0You dont have enough VIP Points !", source, 255, 255, 255 , true) -- end end end addEvent("onClientBuySkin", true) addEventHandler("onClientBuySkin", getRootElement(), BuyWeaponOnServer) Thanks in advance. Have a nice day ^^
  8. Hello guys, check this video out. I just made it, and i dont know what is it with it.
  9. v36u

    Help ! Vip-system.

    Thank you man, it works like a charm ^^
  10. Hello guys ! Im working on a dayz server , and im still learning lua. And i have a problem with a vip system. Here is the code : function givepackvip (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("vip")) then setElementData(thePlayer, "M4A1 CCO SD", 1) setElementData(thePlayer, "M4A1 CCO SD Mag", 150) setElementData(thePlayer, "M4A03", 1) setElementData(thePlayer, "M4A03 Mag", 69) setElementData(thePlayer, "Veteran Backpack", 1) setElementData(thePlayer, "MP5A5", 1) setElementData(thePlayer, "MP5A5 Mag", 150) setElementData(thePlayer, "Binoculars", 1) setElementData(thePlayer, "Burger", 3) setElementData(thePlayer, "Canteen", 3) setElementData(thePlayer, "Morphine", 2) setElementData(thePlayer, "Medical Supplies", 2) setElementData(thePlayer, "Ghillie Suit Ghost", 1) setElementData(thePlayer, "Map", 1) setElementData(thePlayer, "GPS", 1) setElementData(thePlayer, "Toolbox", 1) setElementData(thePlayer, "Infrared Googles", 1) setElementData(thePlayer, "Watch", 1) outputChatBox("#6495ED[DayzLife Romania]#C0C0C0You got the vip pack!", thePlayer, 255, 255, 255, true) end end addCommandHandler("vipitems", givepackvip) I want to make the command be available only once at 10 minutes ( 600000 ms ) [ To avoid players spamming the command for free items ] . I tried with setTimer, but i dont think i understand it so well.. Some help? Thanks in advance ! ^^'
  11. Salut ! Lucrez la un server de dayz, si acum am ajuns la partea in care trebuie sa fac un vip system. Si da, nu sunt mare scripter, inca invat lua, si le pricep. Nu mai am mult de facut la server pana il hostez, dar am intampinat o problema si nu am prieteni care sa se priceapa asa ca am apelat la comunitate ^^ Aici este codul : function givepackvip (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("vip")) then setElementData(thePlayer, "M4A1 CCO SD", 1) setElementData(thePlayer, "M4A1 CCO SD Mag", 150) setElementData(thePlayer, "M4A03", 1) setElementData(thePlayer, "M4A03 Mag", 69) setElementData(thePlayer, "Veteran Backpack", 1) setElementData(thePlayer, "MP5A5", 1) setElementData(thePlayer, "MP5A5 Mag", 150) setElementData(thePlayer, "Binoculars", 1) setElementData(thePlayer, "Burger", 3) setElementData(thePlayer, "Canteen", 3) setElementData(thePlayer, "Morphine", 2) setElementData(thePlayer, "Medical Supplies", 2) setElementData(thePlayer, "Ghillie Suit Ghost", 1) setElementData(thePlayer, "Map", 1) setElementData(thePlayer, "GPS", 1) setElementData(thePlayer, "Toolbox", 1) setElementData(thePlayer, "Infrared Googles", 1) setElementData(thePlayer, "Watch", 1) outputChatBox("#6495ED[DayzLife Romania]#C0C0C0Ai primit pachetul de iteme Vip!", thePlayer, 255, 255, 255, true) end end addCommandHandler("vipitems", givepackvip) Eu vreau sa-i pun un timer de 10 minute ( 600000 ms ) . Adica odata la 10 minute sa poata sa-si ia pachetul vip. Am incercat cu functia setTimer, n-a mers. Probabil n-o inteleg eu bine. Putin ajutor? ^^ Multumesc anticipat.
×
×
  • Create New...