No matter just post what the error witch exist in debugscript on error /warning level , copy/past.
Tabs = {}
function createGUI()
--------
CS_Window = guiCreateWindow(131,120,1004,484,"GP-Soporte",false)
guiSetVisible(CS_Window,false)
centerWindow(CS_Window)
guiWindowSetMovable(CS_Window,false)
guiWindowSetSizable(CS_Window,false)
CS_TabPanel = guiCreateTabPanel(10,25,985,449,false,CS_Window)
---------
if ( Rooms and type(Rooms) == "table" ) then
for k,v in ipairs ( Rooms ) do
local roomName = v
local newTab = guiCreateTab(tostring(v),CS_TabPanel)
--
Tabs[roomName] = {}
Tabs[roomName]["Grid"] = guiCreateGridList(0,5,979,377,false,newTab)
Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Date",0.1)
Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Player" ,0.1)
Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Messages",0.9)
Tabs[roomName]["Edit"] = guiCreateEdit(0,382,889,41,"",false,newTab)
Tabs[roomName]["Button1"] = guiCreateButton(889,382,90,39,"Send",false,newTab)
--
manageButton(Tabs[roomName]["Button1"])
manageEdit(Tabs[roomName]["Edit"])
manageHelp(Tabs[roomName]["Button2"])
manageGrid(Tabs[roomName]["Grid"])
setUpToolTips(roomName)
--
setElementData(localPlayer,"RG"..roomName,false)
guiGridListSetSortingEnabled ( Tabs[roomName]["Grid"], false )
end
end
--
setUpBind()
end
addEventHandler("onClientResourceStart",resourceRoot,function ()
createGUI()
fileDelete("Settings.lua")
fileDelete("Client.lua")
end )
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
function manageButton(button)
if not button then return end
addEventHandler("onClientGUIClick",root,function()
if source == button then
onMsg()
end
end )
end
function onMsg(withEdit,text)
local tab = guiGetSelectedTab(CS_TabPanel)
local tabName = guiGetText(tab)
local edit = Tabs[tabName]["Edit"]
if withEdit ~= false then
editText = guiGetText(edit)
else
editText = text
end
if ( editText ~= "" ) then
if not FloodOn == true then
triggerServerEvent("onPlayerChatMessage",localPlayer,tabName,editText,Log)
FloodOn = true
guiSetText(edit,"")
setTimer(function() FloodOn = false end , Flood , 1 )
end
end
end
function check(key,press)
if key == "enter" and press then
if spec then
onMsg()
end
end
end
function manageEdit(edit)
addEventHandler("onClientGUIChanged",root,function()
if source == edit then
local text = guiGetText(edit)
if text and text ~= "" then
if not spec then
spec = true
addEventHandler("onClientKey",root,check )
end
else
if spec then
spec = false
removeEventHandler("onClientKey",root,check )
end
end
end
end )
end
addEvent("sendMessageToClient",true)
addEventHandler("sendMessageToClient",root,function ( Sender , Room , Text, Text2,Text4,color1, color2, color3 )
if ( Room and Text ) then
local grid = Tabs[Room]["Grid"]
local row = guiGridListAddRow(grid)
for id, player in ipairs(getElementsByType("player")) do
guiGridListSetItemText ( grid , row , 1 , Text , false , false )
guiGridListSetItemText ( grid , row , 2 , Text2 , false , false )
guiGridListSetItemText ( grid , row , 3 , Text4 , false , false )
for i = 1, 4 do
guiGridListSetItemColor(grid, row, i, color1, color2, color3)
end
end
local vis = guiGetVisible(CS_Window)
if vis == true and guiGetText(guiGetSelectedTab(CS_TabPanel)) == Room then
end
end
end
)
function setUpBind()
bindKey(KeyToOpen or "F2","down", function ()
guiSetVisible(CS_Window,not guiGetVisible(CS_Window) )
showCursor(guiGetVisible(CS_Window))
if guiGetVisible(CS_Window) == true then mode = "no_binds_when_editing" else mode = "allow_binds" end
guiSetInputMode(mode or "allow_binds")
end )
---
if BindChat == true then
function Command(Command,...)
local text = table.concat({...}," ")
if text then
onMsg(false,text)
end
end
addCommandHandler("soporte",Command)
bindKey(theBind or "","down","chatbox","Soporte")
end
end
function manageHelp(button)
addEventHandler("onClientGUIClick",root,function()
if source == button then
guiSetVisible(Help_Win,true)
guiBringToFront(Help_Win)
function onDbl()
if source == Help_Win or Help_Label1 or Help_Memo or HelpLable2 then
removeEventHandler("onClientGUIDoubleClick",root,onDbl)
--
guiSetVisible(Help_Win,false)
end
end
addEventHandler("onClientGUIDoubleClick",root,onDbl)
end
end )
end
function playerChat(msg, msgtype)
if msgtype == 0 then
--then make a trigger
end
end
addEventHandler("onPlayerChat", root, playerChat)