Jump to content

[Duda]Dayz Items


StanMarsh

Recommended Posts

Hola como recien me descargo el Day Z Tengo muchas dudas, bueno esta es la primera pregunta: Pickups Bueno quiero hacer aparecer unos Pickups en mi base pero el problema es que solo salen las posiciones y no salen los objeto osea yo pense que saldrian las posiciones y el objeto que es asi que hay necesito una ayudita :cry:

2da Pregunta: Esta es Como puedo hacer o donde puedo encontrar un panel que solo sea para admins o vip que te haga aparecer objetos como armas Comida Medic Kits Agua etc. por que si son armas y te la das del panel admin y reconnectas desaparecen.

3era y final: Skins Unicos Bueno son los skins unicos osea que vienen en otro script como hago para que no se me quiten al ponermelos osea yo me los pongo con el panel admin y al rato se me quita y no se que hacer para que se quede asi o tendre que poner un item extra que no se encuentre solo sea para los admin que contenga ese skin y como podria hacerlo bueno espero con ansias su respuestas :D

PD:Aun quedan varias pero talves la publique en otro post

Link to comment
  • 10 months later...

@StanMarsh

Hola, el primero no se de los pickups

2)_ Para givearte cosas es el addon_give recuerda usar el comando /give con tu cuenta de Administrador para poder givearte cosas.

Server Side

addEvent("onGIPGive", true) 
  
local aclGroup -- // Minimum group in order to access give GUI. 
local isConfigOkay = true -- // Checking if script works correctly. 
  
-- // Adding required information in order to make the addon work correctly. -- 
addEventHandler("onResourceStart", resourceRoot, 
function() 
    call (getResourceFromName("DayZ"), "addAddonInfo", "LuxorDayZ", "Panel de Give") 
    aclGroup = get("aclMinimumGroup") 
    if string.find(aclGroup, ",") then 
        aclGroup = split(aclGroup, ',') 
    end 
    if type(aclGroup) == "string" then 
        if not aclGetGroup(aclGroup) then  
            outputError("Error config meta.xml. Bad ACL Group. Resource will not work")  
            isConfigOkay = false 
            return  
        end 
    else 
        for i, val in ipairs(aclGroup) do 
            if not aclGetGroup(aclGroup[i]) then 
                outputError("Error config meta.xml. Bad ACL Group. Resource will not work")  
                isConfigOkay = false 
                return 
            end 
        end 
    end 
end ) 
  
-- // Handling /give command. -- 
addCommandHandler("give", 
function(pSource) 
     
    if not isConfigOkay then return end 
    if type(aclGroup) == "string" then 
        if not isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(pSource)), aclGetGroup(aclGroup)) then return end 
        triggerClientEvent(pSource, "onGIPOpened", pSource) 
    else 
        for i, _ in ipairs(aclGroup) do 
            if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(pSource)), aclGetGroup(aclGroup[i])) then 
                triggerClientEvent(pSource, "onGIPOpened", pSource) 
                break 
            end 
        end 
    end 
end ) 
  
-- // Function to inform. -- 
function outputError(msg) 
    outputDebugString(msg, 1) 
    outputChatBox(msg, root, 128, 0, 255, true) 
end 
  
-- // Give handler. -- 
addEventHandler("onGIPGive", root, 
function(pName, item, quantity) 
    name = getPlayerName ( source ) 
    setElementData(getPlayerFromName(pName), item, quantity) 
    outputChatBox("El Administrador" ..name.. " le ha dado " ..quantity.." "..item.. " para " ..pName, getRootElement(), 0, 137, 255) 
    outputChatBox("Un Administrador Le Ha Dado:"..quantity.." "..item, getPlayerFromName(pName), 128, 0, 255) 
end ) 

Client Side

addEvent("onGIPOpened", true) 
 
local sW, sH = guiGetScreenSize() -- // Variables needed to know the width and height.
local w =
{  
    gridList = {},
    label = {},
    editBox = {},
    button = {},
    comboBox = {}
}
   
local items =
{
    ["Armas"] = {
        "M4",
        "CZ 550",
        "Heat-Seeking RPG",
        "M136 Rocket Launcher",
        "Winchester 1866",
        "SPAZ-12 Combat Shotgun",
        "M79",
        "AKS-47",
        "Lee Enfield",
        "M1911",
        "M9 SD",
        "PDW",
        "MP5A5",
        "Desert Eagle",
        "Hunting Knife",
        "Hatchet",
        "Crowbar",
        "Golf Club",
        "Parachute",
        "Tear Gas",
        "Grenade",
        "Binoculars",
    },
   
    ["Muriciones"] = {
        "M4 Mag",
        "AK Mag",
        "CZ 550 Mag",
        "Winchester 1866 Mag",
        "SPAZ-12 Pellet",
        "PDW Mag",
        "MP5A5 Mag",
        "1866 Slug",
        "2Rnd. Slug",
        "M79 Granada",
        "M9 SD Mag",
        "M1911 Mag",
        "Desert Eagle Mag",
        "Lee Enfield Mag",
    },
   
    ["Comidas & Bebidas"] = {
        "Water Bottle",
        "Pasta Can",
        "Beans Can",
        "Burger",
        "Pizza",
        "Soda Bottle",
        "Empty Water Bottle",
        "Empty Soda Cans",
        "Scruffy Burgers",
        "Milk",
        "Raw Meat",
        "Cooked Meat"
    },
   
    ["Mochilas"] = {
        "Czech Vest Pouch",
        "Patrol Pack",
        "Assault Pack (ACU)",
        "Survival (ACU)",
        "Alice Pack",
        "British Assault Pack",
        "Czech Backpack",
        "Coyote Backpack",
        "Origem Backpack",
    },
   
    ["herramientas"] = {
        "Box of Matches",
        "Infrared Goggles",
        "Night Vision Goggles",
        "GPS",
        "Map",
        "Toolbox",
        "Watch",
        "Radio Device"
    },
   
    ["Equipo Medico"] = {
        "Bandage",
        "Morphine",
        "Medic Kit",
        "Heat Pack",
        "Blood Bag",
        "Painkiller",
    },
   
    ["Partes De Autos"] = {
        "Tire",
        "Engine",
        "Tank Parts"
    },
   
    ["Ropa"] = {
        "Camouflage Clothing",
        "Ghillie Suit",
        "Civilian Clothing",
        "Civilian[F] Clothing",
        "Survivor Clothing",
        "Survivor[F] Clothing",
        "Camouflage Zombie Clothing",
        "Survivor[F] Clothing",
        "Ghillie[F] Suit",
        "Ghillie Suit Desert",
        "Camouflage[F] Clothing",
    },
   
    ["Editar Status"] = {
        "murders",
        "zombieskilled",
        "headshots",
        "banditskilled",
        "blood",
        "humanity",
        "thirst",
        "food",
        "alivetime",
        "bandit",
    },
   
    ["Otros"] = {
        "Wood Pile",
        "Empty Gas Canister",
        "Full Gas Canister",
        "Roadflare",    
        "Wire Fence",
        "Mine",
        "Tent"
    }
}
 
local isItemSelected = false
 
-- // Window creation code --
addEventHandler("onClientResourceStart", resourceRoot,
function()
    w.main = guiCreateWindow(sW/2 - 179, sH/2 - 165, 358, 330, "Panel Give Objetos LuxorDayZ", false)
    guiWindowSetSizable(w.main, false)
    guiSetAlpha(w.main, 1.00)
 
    w.gridList.main = guiCreateGridList(10, 26, 151, 291, false, w.main)
    w.gridList.column = guiGridListAddColumn( w.gridList.main, "Player", 0.85 )
   
    w.label.desc = guiCreateLabel(176, 26, 178, 22, "Elegir Jugador", false, w.main)
    guiSetFont(w.label.desc, "default-bold-small")
    w.label.desc2 = guiCreateLabel(233, 210, 60, 22, "Cantidad", false, w.main)
    guiSetFont(w.label.desc2, "default-bold-small")
 
    w.comboBox.category = guiCreateComboBox(171, 65, 266, 160, "-- Elija una categoría--", false, w.main)
    w.comboBox.itemList = guiCreateComboBox(171, 145, 266, 50, "-- Seleccionar elemento --", false, w.main)
   
    w.editBox.quantity = guiCreateEdit(231, 234, 55, 26, "", false, w.main)
    w.button.give = guiCreateButton(176, 280, 77, 37, "Dar", false, w.main)
    w.button.close = guiCreateButton(263, 280, 77, 37, "Cerrar", false, w.main)
    guiSetFont(w.button.give, "default-bold-small")
    guiSetProperty(w.button.give, "NormalTextColour", "FFAAAAAA")
    guiSetFont(w.button.close, "default-bold-small")
    guiSetProperty(w.button.close, "NormalTextColour", "FFAAAAAA")
   
    guiSetVisible(w.main, false)
    guiSetEnabled(w.button.give, false)
   
    for key, value in pairs (items) do
        if type(value) == "table" then
            guiComboBoxAddItem(w.comboBox.category, key)
        end
    end
   
    -- // Making quantity be only edited by numbers --
    addEventHandler("onClientGUIChanged", w.editBox.quantity,
    function()
        guiSetText(source, guiGetText(source):gsub("[^0-9]","")) -- // We remove everything which is not a number
        check()
    end)
   
    -- // Changing second combobox items when first one changes --
    addEventHandler("onClientGUIComboBoxAccepted", w.comboBox.category,
    function()
        local text = guiComboBoxGetItemText(w.comboBox.category, guiComboBoxGetSelected(w.comboBox.category))
        guiComboBoxClear(w.comboBox.itemList)
        for i, st in ipairs(items[text]) do
            guiComboBoxAddItem(w.comboBox.itemList, st)
        end
        guiComboBoxAdjustHeight(w.comboBox.itemList, #items[text])
    end )
   
    -- // Showing item when second one was accepted. --
    addEventHandler("onClientGUIComboBoxAccepted", w.comboBox.itemList,
    function()
        isItemSelected = true
        check()
    end )
   
    -- // Handling button that closes. --
    addEventHandler ( "onClientGUIClick", w.button.close,
    function()
        guiSetVisible(w.main, false)
        showCursor(false)
    end, false )
   
    -- // Handling give button. --
    addEventHandler ( "onClientGUIClick", w.button.give,
    function()
        local playerName = guiGridListGetItemText(w.gridList.main, guiGridListGetSelectedItem(w.gridList.main), 1)
        local item = guiComboBoxGetItemText(w.comboBox.itemList, guiComboBoxGetSelected(w.comboBox.itemList))
        if (getPlayerFromName(playerName)) then
            triggerServerEvent("onGIPGive", localPlayer, playerName, item, tonumber(guiGetText(w.editBox.quantity)))
        else
            outputChatBox("Jugador Desconectado ou Nick Errado", 255, 0, 0)
                end
        guiSetVisible(w.main, true)
        showCursor(true)
    end, false )
 
    addEventHandler("onClientGUIClick", w.gridList.main, check)
end )
 
-- // Remi-X function. Sets height depending on item quantity --
function guiComboBoxAdjustHeight ( combobox, itemcount )
    local width = guiGetSize ( combobox, false )
    return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false )
end
 
-- // Handling when the administrator opens the panel --
-- // Handling when the administrator opens the panel --
addEventHandler("onGIPOpened", root,
function()
    guiGridListClear ( w.gridList.main )
    guiSetEnabled(w.button.give, false)  
    isItemSelected = false
    for id, player in ipairs(getElementsByType("player")) do
        if player ~= localplayer then
            local row = guiGridListAddRow ( w.gridList.main )
            guiGridListSetItemText ( w.gridList.main, row, w.gridList.column, getPlayerName ( player ), false, false )
        end
   
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...