Jump to content

onfloow21

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

onfloow21's Achievements

Newbie

Newbie (4/54)

0

Reputation

1

Community Answers

  1. spawnLocations = { {-334.01287841797,755.61181640625,30.81921005249}, {-1429.798828125, -951.255859375, 201.04934692383}, {-2715.1435546875, -2481.720703125, 2.9290246963501}, {-2443.8115234375, 666.802734375, 34.791397094727}, {255.5625, -1826.6689453125, 3.8544130325317}, {2035.9404296875, -1183.443359375, 22.706228256226}, {2857.73046875, 1764.4794921875, 10.8203125}, } lootItems = { {"Toolbox",100}, } function math.percentChance(percent,repeatTime) local hits = 0 for i = 1,repeatTime do local number = math.random(1,1000)/10 if number <= percent then hits = hits+1 end end return hits end respawnAirdrop2Timer2 = false function spawnAirdrop2(player) if isElement(player) and not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then return end if isElement(productq2) then destroyElement(productq2) end if isElement(avialColq2) then destroyElement(avialColq2) end if isElement(blipq2) then destroyElement(blipq2) end if isTimer(respawnAirdrop2Timer2)then killTimer(respawnAirdrop2Timer2) end respawnAirdrop2Timer2 = setTimer(spawnAirdrop2,2100000,1) local item_id = math.random(1,#spawnLocations) x,y,z = spawnLocations[item_id][1],spawnLocations[item_id][2],spawnLocations[item_id][3]-0.16 local location = getZoneName(x,y,z) local city = getZoneName(x,y,z,true) outputChatBox("#FF0000[AIR-DROP] #00FF00SPRIJIN AERIAN AL ARMATEI! SE POATE VEDEA PE MAPA/GPS!", getRootElement(), 255,255,255, true) xpsq,ypsq,zpsq = x,y,z+7,3 xpvq,ypvq,zpvq = x-48,y-16,z+37 xsbq,ysbq,zsbq = x-48,y-16,z+41 xssq,yssq,zssq = x-528,y+2,z+141 xsdq,ysdq,zsdq = x+528,y+2,z+141 blipq2 = createBlip(x,y,z,5) aviaNavaq2 = createObject(1683,xssq,yssq,zssq,0,0,0) moveObject(aviaNavaq2,8000,xsbq,ysbq,zsbq) setTimer(function() parasProdq2 = createObject(2903,xpvq,ypvq,zpvq,0,0,0) moveObject(aviaNavaq2,8000,xsdq,ysdq,zsdq) moveObject(parasProdq2,15000,xpsq,ypsq,zpsq) triggerClientEvent("playAirdrop2Sound",getRootElement()) end,8000,1) setTimer(destroyElement,16100,1,aviaNavaq2) setTimer(function() destroyElement(parasProdq2) productq2 = createObject(2919,x,y,z,0,0,0) setElementFrozen(productq2,true) avialColq2 = createColSphere(x,y,z,2) attachElements(avialColq2,productq2,0,0,0) setElementData(avialColq2,"parent",object) setElementData(avialColq2,"hospitalbox",true) setElementData(avialColq2,"MAX_Slots",0) setElementData(avialColq2, "M16A2", 1) setElementData(avialColq2, "DMR", 1) setElementData(avialColq2, "5.56x45mm Cartridge", 6) setElementData(avialColq2, "7.62x51mm Cartridge", 6) setElementData(avialColq2, "Backpack (Coyote)", 1) setElementData(avialColq2, "Blood Bag", 2) setElementData(avialColq2, "Morphine", 2) setElementData(avialColq2, "Painkiller", 2) setElementData(avialColq2, "GPS", 1) setElementData(avialColq2, "Map", 1) setElementData(avialColq2, "Watch", 1) for i,item in pairs(lootItems)do local value = math.percentChance(item[2],1) if value >= 1 then setElementData(avialColq2,item[1],value) local ammoData,weapID = getWeaponAmmoType(item[1],true) if ammoData then local minBullets,maxBullets = math.floor(getAmmoPlus(ammoData)/3),getAmmoPlus(ammoData)*2 local ammoQuantity = math.random(minBullets,maxBullets) setElementData(avialColq2,ammoData,ammoQuantity) end end end end,23100,1) end spawnAirdrop2() addCommandHandler("spawnairdrop",spawnAirdrop2) addCommandHandler("removeairdrop",function(player) if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then return end if isElement(productq2) then destroyElement(productq2) end if isElement(avialColq2) then destroyElement(avialColq2) end if isElement(blipq2) then destroyElement(blipq2) end if isTimer(respawnAirdrop2Timer2)then killTimer(respawnAirdrop2Timer2) end end) I'm gettin' this ERROR: ardp/Server2.lua:98: attempt to call global 'getWeaponAmmoType' (a nil value)
  2. Hi everyone! I'm using this gamemode. And I want this to be the tab scoreboard. But for some reason it doesn't read the column stats. Any ideas why? local sw, sh = guiGetScreenSize() ColumnName = {{ name = "", width = 100, data = function (element) return getPlayerName ( element ) end },} ColumnStats = { { name = "Humanity", width = 100, data = function (element) return getElementData ( element, "humanity" ) or 0 end }, { name = "Murders", width = 100, data = function (element) return ( getElementData ( element, "murders" ) or 0 ) end }, { name = "Zombieskilled", width = 100, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ) end }, { name = "Alive Time", width = 100, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 0 ) end }, { name = "Status", width = 100, data = function (element) return getElementData ( element, "money" ) or 0 end }, { name = "Group", width = 100, data = function (element) return getElementData ( element, "Group" ) or "None" end }, } local serverName = " Romania DayZ" -- название сервера local topsize = 60 -- величина шляпы local playersize = topsize-30 -- высота одной строки local panelsize = playersize*1 -- величина панели function calculateWidth() local width = 0 for key, value in ipairs( ColumnName ) do width = width + value.width end for key, value in ipairs( ColumnStats ) do width = width + value.width end return width + 60 end local max_players = 50 local ploff = 0 local width = calculateWidth() local baseX = sw/2-width/2 local baseY = sh/2-(panelsize+topsize)/0.5 addEventHandler( "onClientRender", root, function() if getKeyState( "tab" ) == false then ploff = 0; return end if getElementData(getLocalPlayer(),"logedin") then dxDrawRectangle ( baseX, baseY-40, width, topsize+40, tocolor(32,32,32) ) dxDrawText ( serverName, baseX+53, baseY-45, baseX+width, baseY+topsize, tocolor(249,41,0), 2.6, "bankgothic" ) dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(112,112,112,0) ) dxDrawLine ( baseX, baseY+30, baseX+width, baseY+30, tocolor(100,100,100),0.8 ) dxDrawLine ( baseX, baseY+30, baseX, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) local xoff = 60 for i, v in ipairs ( ColumnName ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+70, baseX+xoff+v.width+10, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end for i, v in ipairs ( ColumnStats ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end local playersTable = getElementsByType ( "player" ) dxDrawText ( "Players: "..tostring(#playersTable).." | "..tostring(max_players), baseX-640, baseY+60, baseX+width, baseY+30, tocolor(255,255,255), 1, "default-bold", "center", "center" ) local maxNum = #playersTable if maxNum > 10 then maxNum = 10 end for i = 1, maxNum do dxDrawLine ( baseX, baseY+topsize+playersize*i, baseX+width, baseY+topsize+playersize*i, tocolor(100,100,100),0.5 ) dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1), baseX+25, baseY+topsize+playersize*i, tocolor(255,255,255), 1, "default-bold", "center", "center" ) if playersTable[i+ploff] == localPlayer then dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(112,112,112,80) ) else dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(112,112,112,150) ) end local xoff = 60 for c, d in ipairs ( ColumnName ) do local data = d.data(playersTable[i+ploff]) local r,g,b = 255,255,255 dxDrawText ( data, baseX+xoff-40, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-10, baseY+topsize+playersize*i, tocolor(r,g,b), 0.9, "default-bold", "center", "center" ) xoff = xoff+d.width end for c, d in ipairs ( ColumnStats ) do local data = d.data(playersTable[i+ploff]) local r,g,b = 255,255,255 if d.name == "Group" and data == "None" then r,g,b = 0,255,0 data = "None" end dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-5, baseY+topsize+playersize*i, tocolor(r,g,b), 0.9, "default-bold", "center", "center" ) xoff = xoff+d.width end end end end ) function PlayerScrollMenu (key,keyState,arg) if getElementData(localPlayer,"logedin") and getKeyState( "F4" ) then if ( keyState == "down" ) then if arg == "up" then if ploff > 0 then ploff=ploff-1 end elseif arg == "down" then local playersTable = getElementsByType ( "player" ) if ploff < #playersTable-10 then ploff = ploff+1 end end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" ) function formatTimeFromMinutes(value) if value then local hours = math.floor(value/60) local minutes = math.round(((value/60) - math.floor(value/60))*100/(100/60)) if minutes < 10 then minutes = "0"..minutes end value = hours..":"..minutes return value end return false end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function sendMaxPlayersOnServer (players) max_players = players end addEvent("sendMaxPlayersOnServer",true) addEventHandler("sendMaxPlayersOnServer",getLocalPlayer(),sendMaxPlayersOnServer)
  3. ERROR: vip/vipsystem.lua:3: attempt to call global 'getPlayerFromNamePart' (a nil value) What can I do?
  4. Nvm. Got it by accident. I was trying to solve another bug and found it.
  5. Hi everyone! I can't find the lua where I can edit player spawn inventory. I mean... when he respawns. I'm using NullsystemWorks latest version. Here is the link. I just want to remove the flashlight, because isn't working.
  6. Dude! You have soo many tutorials about lua scripts on the internet. Just say it out loud you need a dev to work for you... Tysm!
×
×
  • Create New...