Jump to content

Help me with my panel


ksTakor

Recommended Posts

Posted

Try This ,

function give(button,state) 
    if button == "left" and state == "down" then 
        local row,col = guiGridListGetSelectedItem(paineldayz.gridlist[1]) 
        if (row and col and row ~= -1 and col ~= -1) then 
        local itemName = guiGridListGetItemText(paineldayz.gridlist[1], row,col, 1) 
            if itemName then 
                local text = guiGetText(paineldayz.edit[1]) 
                setElementData(localPlayer, text, itemName, true) -- code 
            end 
        else 
            outputChatBox("Please select a item from the list.",220,0,0) 
        end 
    end 
end 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

not yet.

I don't know why don't work maybe if you see the panel it's more easy

mtascreen20130416175609.png

The code to give items in dayz gamemode is

Ex. I wanna give an M4

setElementData(getPlayerFromName("[D.A]ksTakor"),"M4",1)

and from my panel i wanna get the item name from the gridlist

and the number of items from my edit box

Posted

Try with:

setElementData(localPlayer, itemName, text) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

I have debugged the script and I find this error:

WARNING: DayzPanel\dayz_panel:154: Bad argument @ 'guiGridListGetSelectedItem' [Expected gui element at argument 1,got table] 

My script is this:

function give (button,state) 
    if button == "left" and state == "up" then 
        local row,col = guiGridListGetSelectedItem(paineldayz.gridlist) 
        if (row and col and row ~= -1 and col ~= -1) then 
        local itemName = guiGridListGetItemText(paineldayz.gridlist, row,col, 1) 
            if itemName then 
                local text = guiGetText(paineldayz.edit[1]) 
                setElementData(localPlayer, itemName, text) -- code 
            end 
        else 
            outputChatBox("Please select a item from the list.",220,0,0) 
        end 
    end 
end 

Posted
function give (button,state) 
    if button == "left" and state == "up" then 
        local row,col = guiGridListGetSelectedItem(paineldayz.gridlist[1]) 
        if (row and col and row ~= -1 and col ~= -1) then 
        local itemName = guiGridListGetItemText(paineldayz.gridlist[1], row,col, 1) 
            if itemName then 
                local text = guiGetText(paineldayz.edit[1]) 
                setElementData(localPlayer, itemName, text) -- code 
            end 
        else 
            outputChatBox("Please select a item from the list.",220,0,0) 
        end 
    end 
end 

I forgot the table index.

Please do not PM me with scripting related question nor support, use the forums instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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