FontGrid = guiCreateFont( "Font.ttf", 10 )
FontSearch = guiCreateFont( "Font.ttf", 10 )
function centerWindow(center_window)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(center_window,false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(center_window,x,y,false)
end
alamaken = {
{"Int",-3577.685546875, -2433.1162109375, 13.7849817276},
}
GUIEditor = {
label = {},
window = {},
}
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFFF")
grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
guiGridListAddColumn(grid, "Positions", 0.9)
edit = guiCreateEdit(9, 25, 261, 24, "", false, GUIEditor.window[1])
guiSetFont(edit,FontSearch)
move = guiCreateButton(53, 335, 166, 29, "", false, GUIEditor.window[1])
label = guiCreateLabel(209, 366, 85, 24, "", false, GUIEditor.window[1])
guiLabelSetColor(label, 255, 0, 0)
addEventHandler ("onClientGUIClick", root,
function()
if (source == ff) then
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
guiSetInputEnabled(false)
end
end
)
------------------------------------------------------------------
function loadalamaken ( )
guiGridListClear(grid)
for i,ha in ipairs(alamaken) do
local row = guiGridListAddRow(grid)
local row = guiGridListAddRow(grid)
guiGridListSetItemText(grid,row,1,ha[1],false,false)
guiGridListSetItemData(grid,row,1,{ha[2],ha[3],ha[4]})
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255))
end
end
addEventHandler("onClientGUIChanged",root,
function ()
if ( source == edit ) then
local text = guiGetText(edit)
if ( text == "" ) then
loadalamaken ( )
else
guiGridListClear(grid)
for i,v in ipairs(alamaken) do
local name = tostring(v[1])
if string.find(string.upper(name),string.upper(guiGetText(edit))) then
local row = guiGridListAddRow(grid)
guiGridListSetItemText(grid,row,1,name,false,false)
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255))
end
end
end
end
end
)
guiSetVisible(GUIEditor.window[1],false)
bindKey("f6","down",
function ()
if guiGetVisible(GUIEditor.window[1]) then
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
guiSetInputEnabled(false)
else
if (getElementDimension(localPlayer) == 30) then return end
guiSetVisible(GUIEditor.window[1],true)
showCursor(true)
guiSetInputEnabled(true)
putInfo()
putPlayers()
end
end
)
for i,v in ipairs(alamaken) do
local row = guiGridListAddRow(grid)
guiGridListSetItemText(grid,row,1,v[1],false,false)
guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]})
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255))
end
addEventHandler("onClientGUIClick",root,
function ()
local sel = guiGridListGetSelectedItem(grid)
if source == move then
if sel ~= -1 then
local x,y,z = unpack(guiGridListGetItemData(grid,sel,1))
if ( getPedOccupiedVehicle ( localPlayer ) ) then
setElementPosition ( getPedOccupiedVehicle ( localPlayer ) , x , y , z )
else
setElementPosition ( localPlayer , x , y , z )
end
else
outputChatBox("* من فضلك اختار مكان للانقال اليه",255,0,0)
end
end
end
)
addEventHandler("onClientGUIDoubleClick",root,function()
if ( source == grid ) then
local sel = guiGridListGetSelectedItem(grid)
if sel ~= -1 then
local x,y,z = unpack(guiGridListGetItemData(grid,sel,1))
if ( getPedOccupiedVehicle ( localPlayer ) ) then
setElementPosition ( getPedOccupiedVehicle ( localPlayer ) , x , y , z )
else
setElementPosition ( localPlayer , x , y , z )
end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
end
end)
fileDelete("client.lua")