Jump to content

ArtekXDPL

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by ArtekXDPL

  1. How repair this script, after Im kill player, not give me money. Im use DayZ gamemode. function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 5000 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted )
  2. ArtekXDPL

    1 error

    Thanks you for help, it work, but how increase damage by hit car to player?
  3. ArtekXDPL

    1 error

    Im have this script, and it have one error: When player is killed, by car he is not respawn. Im use DayZ gamemod. Im try change: addEventHandler("onClientPlayerSpawn", root, to addEventHandler("spawnDayZPlayer", root, but this not, work. local bodyparts = {2908, 2907, 2906, 2906, 2905, 2905} -- head, torso, hand x2, leg x2 function onDamage(attacker) if attacker and getElementType(attacker) == "vehicle" and getElementModel(attacker) == 532 and getElementAlpha(source) == 255 then massacrePed(attacker, source) end end addEventHandler("onClientPedDamage", root, onDamage) addEventHandler("onClientPlayerDamage", root, onDamage) addEventHandler("onClientPlayerSpawn", root, function() setElementAlpha(source, 255) if source == localPlayer then setCameraTarget(source) end end ) function massacrePed(harvester, ped) if harvester and getElementType(harvester) == "vehicle" and getElementModel(harvester) == 532 then local vx, vy, _ = getElementVelocity(harvester) outputChatBox("Velocity: " .. vx .. ", " .. vy) if math.abs(vx) < 0.1 and math.abs(vy) < 0.1 then return end -- checking if ped is attacked by front of combine harvester local x, y, z = getElementPosition(ped) local x2, y2, _ = getRotatedPosition(harvester, 0, 5.5, 0) -- also know as misc_b component if getDistanceBetweenPoints2D(x, y, x2, y2) > 3.5 then return end if ped == localPlayer then setCameraTarget(harvester) end setElementAlpha(ped, 0) setTimer(setElementHealth, 2000, 1, ped, 0) fxAddBlood(x, y, z, 0, 0, 0, 5, 1) local bodies = {} for i, obj in pairs(bodyparts) do setTimer( function() local x, y, z = getVehicleComponentPosition(harvester, "misc_c") x, y, z = getRotatedPosition(harvester, x, y, z) local _, _, rz = getVehicleComponentRotation(harvester, "misc_c") local _, _, rz2 = getElementRotation(harvester) rz = rz - rz2 - 180 x, y = getPointFromDistanceRotation(x, y, 3.4, rz) local o = createObject(obj, x, y, z) setElementRotation(o, math.random(1, 140), math.random(1, 140), math.random(1, 140)) table.insert(bodies, o) if i > 1 then setElementCollidableWith(o, bodies[i-1], false) setElementCollidableWith(bodies[i-1], o, false) end setTimer(setElementVelocity, 50, 1, o, -vx, -vy, math.random(0.01, 0.1)) end, 50*i, 1) end local x, y, z = getRotatedPosition(harvester, -1.3, -3, 1.2) fxAddBlood(x, y, z, 0, 0, 0, 5, 1) playSFX("script", 152, 2, false) -- 'blood' sound --playSFX3D("pain_a", 1, math.random(88, 130), x, y, z, false) -- woman scream --playSFX3D("pain_a", 2, math.random(89, 100), x, y, z, false) -- man scream setTimer( function() for i, obj in pairs(bodies) do destroyElement(obj) end end, 10000, 1) end end function getRotatedPosition(element, distX, distY, distZ) if not element or not isElement(element) then return end local matrix = getElementMatrix(element) if not matrix then return end local offX = distX * matrix[1][1] + distY * matrix[2][1] + distZ * matrix[3][1] + 1 * matrix[4][1] local offY = distX * matrix[1][2] + distY * matrix[2][2] + distZ * matrix[3][2] + 1 * matrix[4][2] local offZ = distX * matrix[1][3] + distY * matrix[2][3] + distZ * matrix[3][3] + 1 * matrix[4][3] return offX, offY, offZ end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end -- rotating misc_c addEventHandler("onClientPlayerVehicleEnter", root, function(veh) if source == localPlayer and getElementModel(veh) == 532 then addEventHandler("onClientRender", root, updateMiscc) end end ) addEventHandler("onClientVehicleStartExit", root, function(player) if player == localPlayer and getElementModel(source) == 532 then removeEventHandler("onClientRender", root, updateMiscc) end end ) function updateMiscc() if isCursorShowing() or isConsoleActive() or isChatBoxInputActive() then return end if getKeyState("num_2") then local veh = getPedOccupiedVehicle(localPlayer) local rx, ry, rz = getVehicleComponentRotation(veh, "misc_c") if rz + 0.5 < 90 then setVehicleComponentRotation(veh, "misc_c", rx, ry, rz+0.2) end playSFX("genrl", 131, 27, false) end if getKeyState("num_8") then local veh = getPedOccupiedVehicle(localPlayer) local rx, ry, rz = getVehicleComponentRotation(veh, "misc_c") if rz - 0.5 > 0 then setVehicleComponentRotation(veh, "misc_c", rx, ry, rz-0.2) end playSFX("genrl", 131, 27, false) end end -- DEBUG --[[local validskins = getValidPedModels() for i=1, 30 do local x, y = getPointFromDistanceRotation(50, 0, 30, 360 * (i/30)) createPed(validskins[math.random(1, #validskins)], x, y, 4) end]]--
  4. can you explain me how repair this error? WARNING: [DayZ-MTA]/DayZ/login.lua:130: Bad argument @ 'spawnPlayer' [Expected number at argument 6, got boolean] local spawnPositions = { {-278.6669921875,-2882.1572265625,32.104232788086}, {-958.5595703125,-2887.9912109375,64.82421875}, {-1816.9375,-2748.18359375,1.7327127456665}, {-2816.166015625,-2439.0546875,2.4004096984863}, {-2941.5673828125,-1206.2373046875,2.7848854064941}, {-2911.51171875,-895.22265625,2.4013109207153}, {-2185.6669921875,2957.380859375,11.474840164185}, {272.2265625,2928.505859375,1.3713493347168}, {2803.943359375,595.9365234375,7.7612648010254}, {2883.7509765625,-178.4658203125,3.2714653015137}, {-233.46484375,-1735.8173828125,1.5520644187927}, {-1056.8720703125,2939.068359375,42.311294555664}, } local playerDataTable = { {"alivetime"}, {"skin"}, {"MAX_Slots"}, {"bandit"}, {"blood"}, {"food"}, {"thirst"}, {"temperature"}, {"currentweapon_1"}, {"currentweapon_2"}, {"currentweapon_3"}, {"bleeding"}, {"brokenbone"}, {"pain"}, {"cold"}, {"infection"}, {"humanity"}, {"zombieskilled"}, {"headshots"}, {"murders"}, {"banditskilled"}, {"Wood Pile"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, {"Box of Matches"}, {"M1911 Mag"}, {"M9 SD Mag"}, {"Desert Eagle Mag"}, {"M1911"}, {"M9 SD"}, {"Winchester 1866"}, {"PDW"}, {"Hunting Knife"}, {"Hatchet"}, {"Pizza"}, {"Morphine"}, {"Soda Bottle"}, {"Empty Gas Canister"}, {"Full Gas Canister"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Grenade"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, {"PDW"}, --{"TEC-9"}, {"AK-47"}, --{"M136 Rocket Launcher"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, --{"Heat-Seeking RPG"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Scruffy Burgers"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Radio Device"}, {"Baseball Bat"}, {"Shovel"}, {"Golf Club"}, {"Radio Device"}, {"Parachute"}, } function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player),"playerID") account = getPlayerAccount(player) -- ORYGINALNA LINIJKA -- local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z") -- local x,y,z = getAccountData(account,"last_x") or 0,getAccountData(account,"last_y") or 0,getAccountData(account,"last_z") or 0 local skin = getAccountData(account,"skin") createZombieTable (player) if getAccountData(account,"isDead") then spawnDayZPlayer(player) return end spawnPlayer (player, x,y,z+0.5, math.random(0,360), skin, 0, 0) setElementFrozen(player, true) fadeCamera (player, true) setCameraTarget (player, player) setTimer( function(player) if isElement(player) then setElementFrozen(player, false) end end,500,1,player) playerCol = createColSphere(x,y,z,1.5) setElementData(player,"playerCol",playerCol) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) for i,data in ipairs(playerDataTable) do local elementData = getAccountData(account,data[1]) if not elementData then if data[1] == "brokenbone" or data[1] == "pain" or data[1] == "cold" or data[1] == "infection" or data[1] == "currentweapon_1" or data[1] == "currentweapon_2" or data[1] == "currentweapon_3" or data[1] == "bandit" then elementData = elementData else elementData = 0 end end setElementData(player,data[1],elementData) end setElementData(player,"logedin",true) --Weapons --Old Weapons local weapon = getElementData(player,"currentweapon_1") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), true ) end local weapon = getElementData(player,"currentweapon_2") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end local weapon = getElementData(player,"currentweapon_3") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end setElementModel(player, getElementData(player,"skin")) setElementData(player,"admin",getAccountData(account,"admin") or false) setElementData(player,"supporter",getAccountData(account,"supporter") or false) triggerClientEvent(player, "onClientPlayerDayZLogin", player) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) function playerRegister(username, pass, player) local number = math.random(table.size(spawnPositions)) local x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3] spawnPlayer (player, x,y,z, math.random(0,360), 73, 0, 0) fadeCamera (player, true) setCameraTarget (player, player) playerCol = createColSphere(x,y,z,1.5) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) ---------------------------------- -- Player Items on Start for i,data in ipairs(playerDataTable) do if data[1] =="Bandage" then setElementData(player,data[1],2) elseif data[1] =="Watch" then setElementData(player,data[1],1) elseif data[1] =="Map" then setElementData(player,data[1],1) elseif data[1] =="Painkiller" then setElementData(player,data[1],1) elseif data[1] =="MAX_Slots" then setElementData(player,data[1],8) elseif data[1] =="skin" then setElementData(player,data[1],73) elseif data[1] =="blood" then setElementData(player,data[1],12000) elseif data[1] =="temperature" then setElementData(player,data[1],37) elseif data[1] =="brokenbone" then setElementData(player,data[1],false) elseif data[1] =="pain" then setElementData(player,data[1],false) elseif data[1] =="cold" then setElementData(player,data[1],false) elseif data[1] =="infection" then setElementData(player,data[1],false) elseif data[1] =="food" then setElementData(player,data[1],100) elseif data[1] =="thirst" then setElementData(player,data[1],100) elseif data[1] =="currentweapon_1" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_2" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_3" then setElementData(player,data[1],false) elseif data[1] =="bandit" then setElementData(player,data[1],false) elseif data[1] =="humanity" then setElementData(player,data[1],2500) else setElementData(player,data[1],0) end end account = getAccount(username) local value = getAccounts() local value = #value setElementData(player,"playerID",value+1) setAccountData(account,"playerID",value+1) setElementData(player,"logedin",true) createZombieTable (player) end addEvent("onPlayerDayZRegister", true) addEventHandler("onPlayerDayZRegister", getRootElement(), playerRegister) function saveAccounts () -- Save in the database local account = getPlayerAccount(source) if account then
  5. Please give me e.g Line 125 correct line
  6. How off respawn random parts in cars on DayZ? example code: for i,veh in ipairs(patriotSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(470,x,y,z) vehCol = createColSphere(x,y,z,2.5) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",38) --Engine + Tires local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) --vehicle_indentifikation setElementData(vehCol,"spawn",{470,x,y,z}) --others setElementData(vehCol,"fuel",10) for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],1) end end end This code generate random parts (Tire, Engine, Tank Parts) in cars after respawn. How change to always after respawn car, in car was: Tire = 0, Engine = 0, Tank Parts = 0?
  7. Next errors: ERROR: DayZ\inventory.lua:579: attempt to compare number with boolean WARNING: DayZ\inventory.lua:756: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:761: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:767: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:773: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] ERROR: DayZ\inventory.lua:1126: C stack overflow WARNING: DayZ\menu_client.lua:337: Bad argument @ 'getVehicleName' [Expected vehicle at argument 1, got object] WARNING: DayZ\menu_client.lua:340: Bad argument @ 'getVehicleName' [Expected vehicle at argument 1, got object] ERROR: DayZ\menu_client.lua:391: attempt to perform arithmetic on local 'x' (a boolean value) inventory.lua --[[ #---------------------------------------------------------------# ----* DayZ MTA Script inventory.lua *---- ----* This Script is owned by Marwin, you are not allowed to use or own it. ----* Owner: Marwin W., Germany, Lower Saxony, Otterndorf ----* Skype: xxmavxx96 ----* *---- #---------------------------------------------------------------# ]] inventoryItems = { ["Weapons"] = { ["Primary Weapon"] = { {"M4",3}, {"CZ 550",3}, {"Winchester 1866",3}, {"SPAZ-12 Combat Shotgun",3}, {"Sawn-Off Shotgun",3}, {"AK-47",3}, {"Lee Enfield",3}, --{"Heat-Seeking RPG",5}, --{"M136 Rocket Launcher",5}, }, ["Secondary Weapon"] = { {"M1911",2}, {"M9 SD",2}, {"PDW",2}, --{"TEC-9",2}, {"MP5A5",3}, {"Desert Eagle",2}, {"Hunting Knife",1}, {"Hatchet",2}, {"Baseball Bat",2}, {"Shovel",2}, {"Golf Club",2}, }, ["Specially Weapon"] = { {"Parachute",1}, {"Tear Gas",1}, {"Grenade",1}, {"Binoculars",1} }, }, ["Ammo"] = { {"M1911 Mag",0.085}, {"M9 SD Mag",0.085}, {"Desert Eagle Mag",0.085}, {"PDW Mag",0.025}, {"MP5A5 Mag",0.025}, {"AK Mag",0.035}, {"M4 Mag",0.035}, {"1866 Slug",0.067}, {"2Rnd. Slug",0.067}, {"SPAZ-12 Pellet",0.067}, {"CZ 550 Mag",0.1}, {"Lee Enfield Mag",0.1}, --{"M136 Rocket",2}, }, ["Food"] = { {"Water Bottle",1}, {"Pasta Can",1}, {"Beans Can",1}, {"Burger",1}, {"Pizza",1}, {"Soda Bottle",1}, {"Milk",1}, {"Cooked Meat",1}, }, ["Items"] = { {"Wood Pile",2}, {"Bandage",1,"Bandage yourself"}, {"Roadflare",1,"Place"}, {"Empty Gas Canister",2}, {"Full Gas Canister",2}, {"Medic Kit",2,"Use"}, {"Heat Pack",1,"Use"}, {"Painkiller",1,"Use"}, {"Morphine",1,"Use"}, {"Blood Bag",1,"Use"}, {"Wire Fence",1,"Build a wire fence"}, {"Raw Meat",1}, {"Tire",2}, {"Engine",5}, {"Tank Parts",3}, {"Tent",3,"Pitch a tent"}, {"Camouflage Clothing",1,"Put clothes on"}, {"Civilian Clothing",1,"Put clothes on"}, {"Survivor Clothing",1,"Put clothes on"}, {"Ghillie Suit",1,"Put clothes on"}, {"Empty Water Bottle",1,"Fill bottle up"}, {"Empty Soda Cans",1}, {"Scruffy Burgers",1}, {"Assault Pack (ACU)",1}, {"Alice Pack",1}, {"Czech Backpack",1}, {"Coyote Backpack",1}, }, ["Toolbelt"] = { {"Night Vision Goggles",1}, {"Infrared Goggles",1}, {"Map",1}, {"Box of Matches",1,"Make a Fire"}, {"Watch",1}, {"GPS",1}, {"Toolbox",1}, {"Radio Device",1}, }, } ------------------------------------------------------------------------------ --INVENTORY local headline = {} local gridlistItems = {} local buttonItems = {} inventoryWindows = guiCreateWindow(0.15, 0.28, 0.72, 0.63, "", true) -- inventoryWindows = guiCreateStaticImage(0.25,0.25,0.5,0.5,"images/scrollmenu_1.png",true) headline["loot"] = guiCreateLabel(0.06, 0.05, 0.34, 0.09,"GEAR",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["loot"],"center") guiSetFont (headline["loot"], "default-bold-small" ) headline["inventory"] = guiCreateLabel(0.60, 0.05, 0.34, 0.09,"INVENTORY",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["inventory"],"center") guiSetFont (headline["inventory"], "default-bold-small" ) gridlistItems["loot"] = guiCreateGridList (0.03, 0.10, 0.39, 0.83,true,inventoryWindows) gridlistItems["loot_colum"] = guiGridListAddColumn( gridlistItems["loot"], "Loot", 0.7 ) gridlistItems["loot_colum_amount"] = guiGridListAddColumn( gridlistItems["loot"], "", 0.2 ) gridlistItems["inventory"] = guiCreateGridList (0.57, 0.11, 0.39, 0.83,true,inventoryWindows) gridlistItems["inventory_colum"] = guiGridListAddColumn( gridlistItems["inventory"], "Inventory", 0.7 ) gridlistItems["inventory_colum_amount"] = guiGridListAddColumn( gridlistItems["inventory"], "", 0.2 ) buttonItems["loot"] = guiCreateButton(0.42, 0.17, 0.04, 0.69, "->", true,inventoryWindows) buttonItems["inventory"] = guiCreateButton(0.53, 0.17, 0.04, 0.69, "<-", true,inventoryWindows) headline["slots"] = guiCreateLabel(0.62, 0.94, 0.29, 0.04,"SLOTS:",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["slots"],"center") guiLabelSetVerticalAlign (headline["slots"],"center") guiSetFont (headline["slots"], "default-bold-small" ) headline["slots_loot"] = guiCreateLabel(0.07, 0.94, 0.29, 0.04,"SLOTS:",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["slots_loot"],"center") guiLabelSetVerticalAlign (headline["slots_loot"],"center") guiSetFont (headline["slots_loot"], "default-bold-small" ) guiSetVisible(inventoryWindows,false) function showInventory (key,keyState) if getElementData(getLocalPlayer(),"logedin") then if ( keyState == "down" ) then guiSetVisible(inventoryWindows,not guiGetVisible(inventoryWindows)) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(inventoryWindows) == true then onClientOpenInventoryStopMenu () else hideRightClickInventoryMenu () end if isPlayerInLoot() then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = getElementData(getLocalPlayer(),"lootname") refreshLoot(col,gearName) end end end end bindKey ( "j", "down", showInventory ) function showInventoryManual () guiSetVisible(inventoryWindows,not guiGetVisible(inventoryWindows)) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(inventoryWindows) == true then onClientOpenInventoryStopMenu () end end function hideInventoryManual () guiSetVisible(inventoryWindows,false) showCursor(false) hideRightClickInventoryMenu () end addEvent("hideInventoryManual",true) addEventHandler("hideInventoryManual",getLocalPlayer(),hideInventoryManual) function refreshInventoryManual () refreshInventory() end addEvent("refreshInventoryManual",true) addEventHandler("refreshInventoryManual",getLocalPlayer(),refreshInventoryManual) function refreshLootManual (loot) refreshLoot(loot) end addEvent("refreshLootManual",true) addEventHandler("refreshLootManual",getLocalPlayer(),refreshLootManual) function refreshInventory() if ( gridlistItems["inventory_colum"] ) then --If the column has been created, fill it with players row1,column1 = guiGridListGetSelectedItem ( gridlistItems["inventory"] ) guiGridListClear(gridlistItems["inventory"]) local row = guiGridListAddRow ( gridlistItems["inventory"] ) --guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"ITEMS", false, false ) local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"PRIMARY WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Primary Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"SECONDARY WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Secondary Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"SPECIAL WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Specially Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"AMMO", true, false ) for id, item in ipairs(inventoryItems["Ammo"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end
  8. Im too stupid to understard this, and Im not good understand english language. use this then : http://translate.google.com/ Google translate wrong translate english text to polish.
  9. Im too stupid to understard this, and Im not good understand english language.
  10. Sorry, but im not understarnd this.
  11. Nie jestem specem w tej dziedzinie, lecz sądze że z odpowienim kodem wszystko jest możliwe.
  12. Thanks you for link, Im test this source, but i guess have this same errors in console, and debugmode, what version 0.6 r294.
  13. Next errors: ERROR: DayZ\inventory.lua:579: attempt to compare number with boolean WARNING: DayZ\inventory.lua:756: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:761: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:767: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] WARNING: DayZ\inventory.lua:773: Bad argument @ 'triggerEvent' [Expected string at argument 1, got player] ERROR: DayZ\inventory.lua:1126: C stack overflow WARNING: DayZ\menu_client.lua:337: Bad argument @ 'getVehicleName' [Expected vehicle at argument 1, got object] WARNING: DayZ\menu_client.lua:340: Bad argument @ 'getVehicleName' [Expected vehicle at argument 1, got object] ERROR: DayZ\menu_client.lua:391: attempt to perform arithmetic on local 'x' (a boolean value) inventory.lua --[[ #---------------------------------------------------------------# ----* DayZ MTA Script inventory.lua *---- ----* This Script is owned by Marwin, you are not allowed to use or own it. ----* Owner: Marwin W., Germany, Lower Saxony, Otterndorf ----* Skype: xxmavxx96 ----* *---- #---------------------------------------------------------------# ]] inventoryItems = { ["Weapons"] = { ["Primary Weapon"] = { {"M4",3}, {"CZ 550",3}, {"Winchester 1866",3}, {"SPAZ-12 Combat Shotgun",3}, {"Sawn-Off Shotgun",3}, {"AK-47",3}, {"Lee Enfield",3}, --{"Heat-Seeking RPG",5}, --{"M136 Rocket Launcher",5}, }, ["Secondary Weapon"] = { {"M1911",2}, {"M9 SD",2}, {"PDW",2}, --{"TEC-9",2}, {"MP5A5",3}, {"Desert Eagle",2}, {"Hunting Knife",1}, {"Hatchet",2}, {"Baseball Bat",2}, {"Shovel",2}, {"Golf Club",2}, }, ["Specially Weapon"] = { {"Parachute",1}, {"Tear Gas",1}, {"Grenade",1}, {"Binoculars",1} }, }, ["Ammo"] = { {"M1911 Mag",0.085}, {"M9 SD Mag",0.085}, {"Desert Eagle Mag",0.085}, {"PDW Mag",0.025}, {"MP5A5 Mag",0.025}, {"AK Mag",0.035}, {"M4 Mag",0.035}, {"1866 Slug",0.067}, {"2Rnd. Slug",0.067}, {"SPAZ-12 Pellet",0.067}, {"CZ 550 Mag",0.1}, {"Lee Enfield Mag",0.1}, --{"M136 Rocket",2}, }, ["Food"] = { {"Water Bottle",1}, {"Pasta Can",1}, {"Beans Can",1}, {"Burger",1}, {"Pizza",1}, {"Soda Bottle",1}, {"Milk",1}, {"Cooked Meat",1}, }, ["Items"] = { {"Wood Pile",2}, {"Bandage",1,"Bandage yourself"}, {"Roadflare",1,"Place"}, {"Empty Gas Canister",2}, {"Full Gas Canister",2}, {"Medic Kit",2,"Use"}, {"Heat Pack",1,"Use"}, {"Painkiller",1,"Use"}, {"Morphine",1,"Use"}, {"Blood Bag",1,"Use"}, {"Wire Fence",1,"Build a wire fence"}, {"Raw Meat",1}, {"Tire",2}, {"Engine",5}, {"Tank Parts",3}, {"Tent",3,"Pitch a tent"}, {"Camouflage Clothing",1,"Put clothes on"}, {"Civilian Clothing",1,"Put clothes on"}, {"Survivor Clothing",1,"Put clothes on"}, {"Ghillie Suit",1,"Put clothes on"}, {"Empty Water Bottle",1,"Fill bottle up"}, {"Empty Soda Cans",1}, {"Scruffy Burgers",1}, {"Assault Pack (ACU)",1}, {"Alice Pack",1}, {"Czech Backpack",1}, {"Coyote Backpack",1}, }, ["Toolbelt"] = { {"Night Vision Goggles",1}, {"Infrared Goggles",1}, {"Map",1}, {"Box of Matches",1,"Make a Fire"}, {"Watch",1}, {"GPS",1}, {"Toolbox",1}, {"Radio Device",1}, }, } ------------------------------------------------------------------------------ --INVENTORY local headline = {} local gridlistItems = {} local buttonItems = {} inventoryWindows = guiCreateWindow(0.15, 0.28, 0.72, 0.63, "", true) -- inventoryWindows = guiCreateStaticImage(0.25,0.25,0.5,0.5,"images/scrollmenu_1.png",true) headline["loot"] = guiCreateLabel(0.06, 0.05, 0.34, 0.09,"GEAR",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["loot"],"center") guiSetFont (headline["loot"], "default-bold-small" ) headline["inventory"] = guiCreateLabel(0.60, 0.05, 0.34, 0.09,"INVENTORY",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["inventory"],"center") guiSetFont (headline["inventory"], "default-bold-small" ) gridlistItems["loot"] = guiCreateGridList (0.03, 0.10, 0.39, 0.83,true,inventoryWindows) gridlistItems["loot_colum"] = guiGridListAddColumn( gridlistItems["loot"], "Loot", 0.7 ) gridlistItems["loot_colum_amount"] = guiGridListAddColumn( gridlistItems["loot"], "", 0.2 ) gridlistItems["inventory"] = guiCreateGridList (0.57, 0.11, 0.39, 0.83,true,inventoryWindows) gridlistItems["inventory_colum"] = guiGridListAddColumn( gridlistItems["inventory"], "Inventory", 0.7 ) gridlistItems["inventory_colum_amount"] = guiGridListAddColumn( gridlistItems["inventory"], "", 0.2 ) buttonItems["loot"] = guiCreateButton(0.42, 0.17, 0.04, 0.69, "->", true,inventoryWindows) buttonItems["inventory"] = guiCreateButton(0.53, 0.17, 0.04, 0.69, "<-", true,inventoryWindows) headline["slots"] = guiCreateLabel(0.62, 0.94, 0.29, 0.04,"SLOTS:",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["slots"],"center") guiLabelSetVerticalAlign (headline["slots"],"center") guiSetFont (headline["slots"], "default-bold-small" ) headline["slots_loot"] = guiCreateLabel(0.07, 0.94, 0.29, 0.04,"SLOTS:",true,inventoryWindows) guiLabelSetHorizontalAlign (headline["slots_loot"],"center") guiLabelSetVerticalAlign (headline["slots_loot"],"center") guiSetFont (headline["slots_loot"], "default-bold-small" ) guiSetVisible(inventoryWindows,false) function showInventory (key,keyState) if getElementData(getLocalPlayer(),"logedin") then if ( keyState == "down" ) then guiSetVisible(inventoryWindows,not guiGetVisible(inventoryWindows)) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(inventoryWindows) == true then onClientOpenInventoryStopMenu () else hideRightClickInventoryMenu () end if isPlayerInLoot() then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = getElementData(getLocalPlayer(),"lootname") refreshLoot(col,gearName) end end end end bindKey ( "j", "down", showInventory ) function showInventoryManual () guiSetVisible(inventoryWindows,not guiGetVisible(inventoryWindows)) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(inventoryWindows) == true then onClientOpenInventoryStopMenu () end end function hideInventoryManual () guiSetVisible(inventoryWindows,false) showCursor(false) hideRightClickInventoryMenu () end addEvent("hideInventoryManual",true) addEventHandler("hideInventoryManual",getLocalPlayer(),hideInventoryManual) function refreshInventoryManual () refreshInventory() end addEvent("refreshInventoryManual",true) addEventHandler("refreshInventoryManual",getLocalPlayer(),refreshInventoryManual) function refreshLootManual (loot) refreshLoot(loot) end addEvent("refreshLootManual",true) addEventHandler("refreshLootManual",getLocalPlayer(),refreshLootManual) function refreshInventory() if ( gridlistItems["inventory_colum"] ) then --If the column has been created, fill it with players row1,column1 = guiGridListGetSelectedItem ( gridlistItems["inventory"] ) guiGridListClear(gridlistItems["inventory"]) local row = guiGridListAddRow ( gridlistItems["inventory"] ) --guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"ITEMS", false, false ) local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"PRIMARY WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Primary Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"SECONDARY WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Secondary Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"SPECIAL WEAPON", true, false ) for id, item in ipairs(inventoryItems["Weapons"]["Specially Weapon"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],"AMMO", true, false ) for id, item in ipairs(inventoryItems["Ammo"]) do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1]) >= 1 then local row = guiGridListAddRow ( gridlistItems["inventory"] ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum"],item[1], false, false ) guiGridListSetItemText ( gridlistItems["inventory"], row, gridlistItems["inventory_colum_amount"],getElementData(getLocalPlayer(),item[1]), false, false ) end end
  14. Thanks you for reply. Im use gamemode DayZ 0.6 r294 + default bot (slothbot?). This bots is include in DayZ 0.6 r294 server files. Im find error in this script: WARNING: guns\command_kill.lua:38: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'mouse1'] command_kill.lua function attach ( ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if theVehicle then local x,y,z = getElementPosition ( theVehicle ) weapon = createWeapon("minigun",x-3, y , z+1) setElementRotation(weapon,0,0,7) attachElements ( weapon, theVehicle, -0.2, -1.5, -0.2) setWeaponClipAmmo(weapon, 99999) setWeaponState(weapon, "ready") setWeaponProperty(weapon, "fire_rotation", 0, -30, 0) setElementPosition(localPlayer,x-1.5, y , z+1) end end addCommandHandler ( "attach", attach ) local aimSensitivity = 30; function rotateGun_Handler(cX, cY, aX, aY, wX, wY, wZ) local oX, oY, oZ, oRX, oRY, oRZ = getElementAttachedOffsets(weapon); if (oRX-((cY-0.5)*aimSensitivity) > 345 or oRX-((cY-0.5)*aimSensitivity) < 30) then -- Pitch Restriction oRX = oRX-((cY-0.5)*aimSensitivity); end if (oRZ-((cX-0.5)*aimSensitivity) > 330 or oRZ-((cX-0.5)*aimSensitivity) < 360) then -- Yaw Restriction oRZ = oRZ-((cX-0.5)*aimSensitivity); end setCameraTarget(weapon,weapon) setElementAttachedOffsets(weapon, oX, oY, oZ, oRX, oRY, oRZ); setCursorPosition(screenW/2, screenH/2); end addEventHandler( "onClientCursorMove", getRootElement( ), rotateGun_Handler) function fireme() setTimer(function() if getWeaponState(weapon) == "ready" then setWeaponState(weapon, "firing") else return end end,1000,0) end bindKey("mouse1", "down", fireme)
  15. This script not give money after kill zombie. addEvent("onBotWasted",true) addEventHandler("onBotWasted",root, function (killer) givePlayerMoney(killer,50) addPlayerZombieKills(killer) end) This script also not work: local ZOMBIE_REWARD = 50 -- The amount of money rewarded to a player once killed addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( player ) givePlayerMoney ( player, ZOMBIE_REWARD ) end )
  16. Thanks you very much for help Im have plugin "rav" and its work almost correct, but when Im respawn cars. Press J (Gear) not work. Im not can give Tire, engine, and tank parts in vehicle, and car not drive. local respawn = 30 local r addCommandHandler("rav",function(player) if isTimer(r) then resetTimer(r) outputDebugString("Timer Reset") return end outputChatBox("RESPAWNING ALL UNOCCUPIED VEHICLES IN ".. respawn.."SECONDS") outputDebugString("Cars Respawning") r = setTimer(function() for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- For every vehicle do the following... if isEmpty( vehicle ) then resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time respawnVehicle ( vehicle ) end end outputDebugString("Cars Respawned") outputChatBox("ALL UNOCCUPIED VEHICLES RESPAWNED") end,respawn*1000,1) end) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end Next errors in Admin_Tag.lua WARNING: admins_tags\Admin_Tag.lua:8: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean] WARNING: admins_tags\Admin_Tag.lua:23: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean] addEventHandler("onPlayerChat", root, function(msg, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin")) and type == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000[ADMIN] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "HeadAdmin" ) ) and type == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0077*[Head.Admin] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#FF6000*[ Super.Moderator ] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#00FF00*[ Moderator ] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Owner" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#A000FF*[ Owner ] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Everyone" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#FFAC19*[ Everyone ] " .. getPlayerName ( source ) .. ":#ffffff " .. msg, getRootElement(), r, g, b, true ) end end ) When normal player say /dap he see DayZ Admin Panel. How fix it? server.lua addEvent("dap.openGUI", true) addEventHandler("dap.openGUI", getRootElement(), function() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then triggerClientEvent(source, "dap.openGUI.return", source) end end) addEvent("dap.clientRequestsPlayerInfo", true) addEventHandler("dap.clientRequestsPlayerInfo", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then local targetMoney = getPlayerMoney(target) --TRIGGER triggerClientEvent(source, "dap.clientRequestsPlayerInfo.return", source, target, targetMoney) end end) addEvent("dap.givePlayerItem", true) addEventHandler("dap.givePlayerItem", getRootElement(), function(target, item, quantity) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setElementData(target, tostring(item), tonumber(quantity)) outputChatBox("[DayZ Admin] Gave: "..getPlayerName(target).."#FFFFFF, "..quantity.."x "..item, source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Admin gave you: "..quantity.."x "..item, target, 255, 255, 255, true) end end) addEvent("dap.player.setBlood", true) addEventHandler("dap.player.setBlood", getRootElement(), function(target, value) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setElementData(target, "blood", tonumber(value)) outputChatBox("[DayZ Admin] Set: "..getPlayerName(target).."#FFFFFF Blood "..tostring(value), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Set: Blood "..tostring(value), target, 255, 255, 255, true) end end) addEvent("dap.player.killTarget", true) addEventHandler("dap.player.killTarget", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and target then setElementData(target, "blood", -100) outputChatBox("[DayZ Admin] Killed player "..getPlayerName(target), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] You were killed by Admin "..getPlayerName(source), target, 255, 255, 255, true) end end) addEvent("dap.player.warpToTarget", true) addEventHandler("dap.player.warpToTarget", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and target then if not isPedInVehicle(target) then setElementPosition(source, getElementPosition(target)) elseif isPedInVehicle(target) then warpPedIntoVehicle(source, getPedOccupiedVehicle(target)) end outputChatBox("[DayZ Admin] Warped to "..getPlayerName(target), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Admin "..getPlayerName(source).."#FFFFFF warped to you", target, 255, 255, 255, true) end end) --Vehicle Functions addEvent("dap.vehicleFunctions.fix", true) addEventHandler("dap.vehicleFunctions.fix", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and isPedInVehicle(target) then fixVehicle(getPedOccupiedVehicle(target)) outputChatBox("[DayZ Admin] Fix: "..getPlayerName(target).."#FFFFFF - "..getVehicleName(getPedOccupiedVehicle(target)), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Fix: Admin "..getPlayerName(source).."#FFFFFF fixed your vehicle", target, 255, 255, 255, true) end end) addEvent("dap.vehicleFunctions.destroy", true) addEventHandler("dap.vehicleFunctions.destroy", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and isPedInVehicle(target) then outputChatBox("[DayZ Admin] Destroy: "..getPlayerName(target).."#FFFFFF - "..getVehicleName(getPedOccupiedVehicle(target)), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Destroy: Admin "..getPlayerName(source).."#FFFFFF destroyed your vehicle", target, 255, 255, 255, true) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "MAX_Slots", 0) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "Engine_inVehicle", 0) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "Tire_inVehicle", 0) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "Parts_inVehicle", 0) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "fuel", 0) setElementData(getElementData(getPedOccupiedVehicle(target), "parent"), "vehicle", false) destroyElement(getPedOccupiedVehicle(target)) end end) addEvent("dap.vehicleFunctions.blow", true) addEventHandler("dap.vehicleFunctions.blow", getRootElement(), function(target) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and isPedInVehicle(target) then outputChatBox("[DayZ Admin] Blow: "..getPlayerName(target).."#FFFFFF - "..getVehicleName(getPedOccupiedVehicle(target)), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Blow: Admin "..getPlayerName(source).."#FFFFFF blew your vehicle", target, 255, 255, 255, true) blowVehicle(getPedOccupiedVehicle(target)) end end) --Spawn Vehicle addEvent("dap.spawnVehicle", true) addEventHandler("dap.spawnVehicle", getRootElement(), function(target, vehicle) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) and target and vehicle then if vehicle == "Bobcat" then vehID = 422 vehMaxSlots = 28 vehMaxFuel = 80 engine = 1 tires = 4 parts = 1 elseif vehicle == "Patriot" then vehID = 470 vehMaxSlots = 42 vehMaxFuel = 100 engine = 1 tires = 4 parts = 1 elseif vehicle == "Sanchez" then vehID = 468 vehMaxSlots = 8 vehMaxFuel = 30 engine = 1 tires = 2 parts = 1 elseif vehicle == "Police LS" then vehID = 596 vehMaxSlots = 28 vehMaxFuel = 60 engine = 1 tires = 4 parts = 1 elseif vehicle == "Police SF" then vehID = 597 vehMaxSlots = 32 vehMaxFuel = 60 engine = 1 tires = 4 parts = 1 elseif vehicle == "Barracks" then vehID = 433 vehMaxSlots = 72 vehMaxFuel = 140 engine = 1 tires = 6 parts = 1 elseif vehicle == "Coach" then vehID = 437 vehMaxSlots = 56 vehMaxFuel = 140 engine = 1 tires = 6 parts = 1 elseif vehicle == "Reefer" then vehID = 453 vehMaxSlots = 30 vehMaxFuel = 60 engine = 1 tires = 0 parts = 1 elseif vehicle == "Tropic" then vehID = 454 vehMaxSlots = 30 vehMaxFuel = 60 engine = 1 tires = 0 parts = 1 elseif vehicle == "Bike" then vehID = 509 vehMaxSlots = 0 vehMaxFuel = 0 engine = 0 tires = 0 parts = 0 elseif vehicle == "Maverick" then vehID = 487 vehMaxSlots = 32 vehMaxFuel = 60 engine = 1 tires = 0 parts = 1 elseif vehicle == "Police Maverick" then vehID = 497 vehMaxSlots = 10 vehMaxFuel = 60 engine = 1 tires = 0 parts = 1 elseif vehicle == "Dodo" then vehID = 593 vehMaxSlots = 10 vehMaxFuel = 60 engine = 1 tires = 3 parts = 1 --Admin only elseif vehicle == "Hydra" then vehID = 520 vehMaxSlots = 0 vehMaxFuel = 80 engine = 1 tires = 6 parts = 1 elseif vehicle == "Hunter" then vehID = 425 vehMaxSlots = 0 vehMaxFuel = 80 engine = 1 tires = 3 parts = 1 elseif vehicle == "Rhino" then vehID = 432 vehMaxSlots = 8 vehMaxFuel = 160 engine = 1 tires = 8 parts = 1 end local x, y, z = getElementPosition(target) local rx, ry, rz = getElementRotation(target) local veh = createVehicle(vehID, x, y, z, rx, ry, rz) local vehCol = createColSphere(x + 5, y, z, 4) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", vehMaxSlots) setElementData(vehCol, "Tire_inVehicle", tires) setElementData(vehCol, "Engine_inVehicle", engine) setElementData(vehCol, "Parts_inVehicle", parts) setElementData(vehCol, "spawn", {vehID, x, y, z}) setElementData(vehCol, "fuel", vehMaxFuel) warpPedIntoVehicle(target, veh) outputChatBox("[DayZ Admin] Spawn: "..vehicle.." to "..getPlayerName(target), source, 255, 255, 255, true) outputChatBox("[DayZ Admin] Spawn: Admin "..getPlayerName(source).."#FFFFFF gave you a "..vehicle, target, 255, 255, 255, true) end end)
×
×
  • Create New...