Jump to content

مشكله dgs ~


Recommended Posts

function Button( ) 
if _bug then 
return 'Stuuuuuupid :Pp' 
end
if ( source == BTN1 ) then 
if ( DGS:dgsGridListGetSelectedItem ( wnd.grid ) ~= -1 ) then 
local ammount = tonumber ( DGS:dgsGridListGetItemText ( wnd.grid, DGS:dgsGridListGetSelectedItem ( wnd.grid ), 2 ) )
if ammount > 1 then
triggerServerEvent ( 'Package:openPack', localPlayer, DGS:dgsGridListGetItemData ( wnd.grid, DGS:dgsGridListGetSelectedItem ( wnd.grid ), 1 ) )
DGS:dgsGridListGetItemText ( wnd.grid, DGS:dgsGridListGetSelectedItem ( wnd.grid ), 2, tostring ( ammount - 1 ), false, false )
else
triggerServerEvent ( 'Package:openPack', localPlayer, DGS:dgsGridListGetItemData ( wnd.grid, DGS:dgsGridListGetSelectedItem ( wnd.grid ), 1 ) )
DGS:dgsGridListRemoveRow ( wnd.grid, DGS:dgsGridListGetSelectedItem ( wnd.grid ) )
end
end
elseif ( source == BTN2 ) then 
DGS:dgsSetVisible (ccPack, false )
showCursor ( false )
removeEventHandler("onClientRender", root,MCPack)
end
end
addEventHandler( 'onDgsMouseClick', root, Button)

وش المشكله بذي لما اعطيه الحدث ماتبين بلجريد ليست ؟
مايكتب لي شي بلدي بق

dgs-master جبته من

addEvent ( 'addPackToGrid', true )
addEventHandler ( 'addPackToGrid', root,
function ( packages )
    if packages then
        DGS:dgsGridListClear ( wnd.grid )
        for i,v in ipairs ( packages ) do
            local row = DGS:dgsGridListAddRow ( wnd.grid )
            local type
            if v['number'] == 1 then
                type = 'Gold'
            elseif v['number'] == 2 then
                type = 'Silver'
            elseif v['number'] == 3 then
                type = 'Bronze'
            end
            DGS:dgsGridListGetItemText ( wnd.grid, row, 1, tostring ( type ), false, false )
            DGS:dgsGridListGetItemText ( wnd.grid, row, 2, tostring ( v['ammount'] ), false, false )
            DGS:dgsGridListGetItemData ( wnd.grid, row, 1, tostring ( v['number'] ) )
        end
    end
end)   

 

Link to comment

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...