By: Mr.R
Edit: 39
local Skins = {
[ 1 ] = { "شخصية سوات", 285 },
[ 2 ] = { "شخصية ارمي", 287 },
}
addEventHandler ( "onClientResourceStart", resourceRoot, function ( )
Window = guiCreateWindow ( 0.28, 0.31, 0.45, 0.58, "لوحة الشخصيات", true )
guiSetVisible ( wnd, false )
GridList = guiCreateGridList ( 9, 70, 342, 225, false, Window )
guiGridListAddColumn ( GridList, "الشخصيات", 0.9 )
for k,v in ipairs ( Skins ) do
local Row = guiGridListAddRow ( GridList )
guiGridListSetItemText( GridList, Row, 1, v[1], false, false )
guiGridListSetItemData( GridList, Row, 1, v[2] )
end
Button = guiCreateButton ( 122, 307, 119, 31, "اخيتار", false, Window )
end )
bindKey ( "F5", "down", function ( )
guiSetVisible ( Window, not guiGetVisible ( Window ) )
showCursor ( guiGetVisible ( Window ) )
end )
addEventHandler ( "onClientGUIClick", resourceRoot, function ( )
if ( source == Button ) then
if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then
local Select = guiGridListGetItemText ( GridList, guiGridListGetSelectedItem ( GridList ), 1 )
local skinID = tonumber ( guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) )
triggerServerEvent ( "Getskin", localPlayer, skinID )
else
outputChatBox ( "* الرجاء اختيار شخصيه", 255, 255, 255, true )
end
end
end )
addEvent ( "CloseWindow", true )
addEventHandler ( "CloseWindow", root, function ( )
guiSetVisible ( Window, false )
showCursor ( false )
end )