GUIEditor = {
tabpanel = {},
tab = {}
}
shopWindow = guiCreateWindow(224, 129, 442, 389, "shop send", false)
guiSetVisible (shopWindow, false)
guiWindowSetSizable(shopWindow, false)
guiSetAlpha(shopWindow, 1.00)
GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 21, 424, 359, false, shopWindow)
GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1])
nameEdit = guiCreateEdit(211, 115, 165, 35, "", false, GUIEditor.tab[1])
amountEdit = guiCreateEdit(211, 169, 165, 35, "", false, GUIEditor.tab[1])
sendBTN = guiCreateButton(213, 226, 102, 39, "send", false, GUIEditor.tab[1])
setTimer(
function()
playerList = guiCreateGridList(8, 8, 154, 322, false, GUIEditor.tab[1])
guiGridListSetSelectionMode(playerList, 2)
local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85)
if ( cl and guiGetVisible(shopWindow) == true ) then
for _,name in ipairs(getElementsByType("player")) do
local rw = guiGridListAddRow(playerList)
guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false)
end
addEventHandler("onClientGUIClick", playerList, onClickPlayerName)
end
end
,4000,0)
function onClickPlayerName ()
local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1)
guiSetText(nameEdit, name)
end
function onClickPlayerName ()
local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1)
guiSetText(nameEdit, name)
end
addEventHandler("onClientGUIClick",sendBTN,
function()
triggerServerEvent("onSendMoney", getLocalPlayer(), guiGetText(nameEdit), guiGetText(amountEdit))
end,false
)
bindKey ( "F2" , "down" , function()
guiSetVisible(shopWindow,not guiGetVisible(shopWindow))
showCursor(not isCursorShowing())
end
)