orcun99 Posted July 27, 2017 Share Posted July 27, 2017 (edited) function addGroup(client, group) local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) what's wrong ? debugscript 3 : bad argument @ 'getplayeraccount' Edited July 27, 2017 by orcun99 Link to comment
Addlibs Posted July 27, 2017 Share Posted July 27, 2017 (edited) In function addGroup(client, group), client and group correspond to guiGetText(name) and guiGridListGetSelectedItem(groupGrid), respectively, from the client-side. So you're inputting a string where a player element should be. Just don't name the first parament client and it should work. Edited July 27, 2017 by MrTasty Link to comment
orcun99 Posted July 27, 2017 Author Share Posted July 27, 2017 24 minutes ago, MrTasty said: In function addGroup(client, group), client and group correspond to guiGetText(name) and guiGridListGetSelectedItem(groupGrid), respectively, from the client-side. So you're inputting a string where a player element should be. Just don't name the first parament client and it should work. Sorry But I don't understand for example my account name : admin what should I write here? https://prntscr.com/g14y9q Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 17 hours ago, orcun99 said: function addGroup(client, group) local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) what's wrong ? debugscript 3 : bad argument @ 'getplayeraccount' try this function addGroup(clientname, group) local client=getPlayerFromName(clientname) local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) 1 Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 13 minutes ago, Master_MTA said: try this function addGroup(clientname, group) local client=getPlayerFromName(clientname) local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) still same problem Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 Just now, orcun99 said: still same problem sorry i didn't see the photo till now u should edit it like that function addGroup(clientname, group) local client=getAccountPlayer(clientname) if client then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 17 minutes ago, Master_MTA said: sorry i didn't see the photo till now u should edit it like that function addGroup(clientname, group) local client=getAccountPlayer(clientname) if client then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) still don't work erorr: https://prntscr.com/g1cnc3 1 Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 5 minutes ago, orcun99 said: still don't work erorr: https://prntscr.com/g1cnc3 am so sorry i forgot it edit this local client=getAccountPlayer(clientname) to this local client=getAccountPlayer(getAccount(clientname)) Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 (edited) 3 minutes ago, Master_MTA said: am so sorry i forgot it edit this local client=getAccountPlayer(clientname) to this local client=getAccountPlayer(getAccount(clientname)) new erorr : @'getaccountplayer' [expected account at argument 1,got boolean] Edited July 28, 2017 by orcun99 Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 9 minutes ago, orcun99 said: new erorr : @'getaccountplayer' [expected account at argument 1,got boolean] so the wrong is from client side you should make sure that you enter the right account name Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 (edited) There is full script code: server.lua addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccount(clientname)) if client then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} function openWindow() showCursor(true) window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", true, window) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) I'm sure %100 true account name you can check my accname : https://prntscr.com/g1cx96 Edited July 28, 2017 by orcun99 Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 8 minutes ago, orcun99 said: There is full script code: server.lua addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccount(clientname)) if client then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} function openWindow() showCursor(true) window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", true, window) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) next time use lua tag and try this addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccount(clientname)) if isElement(client) then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) function openWindow() showCursor(true) guiSetVisible(window,true) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) elseif source==name then guiSetText(source,'') end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 textbox is gone and I press add button anyway still erorr check debugscript 3 https://prnt.sc/g1d261 Link to comment
Dimos7 Posted July 28, 2017 Share Posted July 28, 2017 addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccountName(clientname)) if isElement(client) then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) function openWindow() showCursor(true) guiSetVisible(window,true) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) elseif source==name then guiSetText(source,'') end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) try like that idk if it will work Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 2 minutes ago, Dimos7 said: addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccountName(clientname)) if isElement(client) then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) function openWindow() showCursor(true) guiSetVisible(window,true) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) elseif source==name then guiSetText(source,'') end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) try like that idk if it will work textbox is gone Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) to name = guiCreateMemo(0.05, 0.09, 0.75, 0.11, "Enter account name", true, window) Link to comment
Dimos7 Posted July 28, 2017 Share Posted July 28, 2017 (edited) i didn't change the client for textbox omg no memo name = guiCreateEdit(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) Edited July 28, 2017 by Dimos7 Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 textbox is back but https://prnt.sc/g1d7x8 Link to comment
Dimos7 Posted July 28, 2017 Share Posted July 28, 2017 addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) end end ) function addGroup(clientname, group) local client=getAccountPlayer(getAccount(clientname)) if isElement(client) then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end end end addEvent("addPlayerToGroup", true) addEventHandler("addPlayerToGroup", resourceRoot, addGroup) function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) end end addEvent("removePlayerFromGroup", true) addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" } confedgroups = {"confedrecruit", "confedsoldier"} rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateEdit(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window) function openWindow() showCursor(true) guiSetVisible(window,true) end addEvent("createWindow", true) addEventHandler("createWindow", root, openWindow) function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillugrid", true) addEventHandler("fillugrid", root, fillUnionGrids) function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillcgrid", true) addEventHandler("fillcgrid", root, fillConfGrids) function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) end end addEvent("fillagrid", true) addEventHandler("fillagrid", root, fillAdminGrids) function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) elseif source==name then guiSetText(source,'') end end addEventHandler("onClientGUIClick", root, close) function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, addThePlayer) function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) end end addEventHandler("onClientGUIClick", root, removeThePlayer) Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 (edited) 10 minutes ago, Dimos7 said: addCommandHandler("group", function(source) if exports.Qacl:isPlayerInGroup(source, "admin") or exports.Qacl:isPlayerInGroup(source, "subadmin") then triggerClientEvent(source, "createWindow", getRootElement()) triggerClientEvent(source, "fillagrid", getRootElement()) triggerClientEvent(source, "fillcgrid", getRootElement()) triggerClientEvent(source, "fillugrid", getRootElement()) endend)function addGroup(clientname, group)local client=getAccountPlayer(getAccount(clientname)) if isElement(client) then local playerToAdd = getPlayerAccount(client) if not exports.Qacl:isPlayerInGroup(playerToAdd, group)then exports.Qacl:addAccountToGroup(playerToAdd,group) exports.Qcommands:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0, client) end endendaddEvent("addPlayerToGroup", true)addEventHandler("addPlayerToGroup", resourceRoot, addGroup)function removeGroup(client, group) local playerToRemove = getPlayerAccount(client) if exports.Qacl:isPlayerInGroup(playerToAdd, group) then exports.Qacl:removeAccountFromGroup(playerToRemove,group) exports.Qcommands:sendMessage("You've been removed from: " ..group.. "!", 0, 150, 0, client) endendaddEvent("removePlayerFromGroup", true)addEventHandler("removePlayerFromGroup", resourceRoot, removeGroup) client.lua uniongroups = {"unionrecruit", "unionsoldier" }confedgroups = {"confedrecruit", "confedsoldier"}rpgroups = {"ssmember", "nsamember", "aramember", "lsfdmember", "usocmember"} window = guiCreateWindow(555, 381, 220, 288, "Q:RPG - Group management", false) guiWindowSetSizable(window, false) groupGrid = guiCreateGridList(10, 70, 201, 176, false, window) guiGridListAddColumn(groupGrid, "Groups:", 0.9) addButton = guiCreateButton(10, 254, 95, 25, "Add", false, window) remButton = guiCreateButton(110, 254, 95, 25, "Remove", false, window) closeButton = guiCreateButton(184, 31, 27, 23, "X", false, window) name = guiCreateEdit(0.05, 0.09, 0.75, 0.11, "Enter account name", false, window)function openWindow() showCursor(true) guiSetVisible(window,true) endaddEvent("createWindow", true)addEventHandler("createWindow", root, openWindow)function fillUnionGrids() for i,v in ipairs(uniongroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) endendaddEvent("fillugrid", true)addEventHandler("fillugrid", root, fillUnionGrids)function fillConfGrids() for i,v in ipairs(confedgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) endendaddEvent("fillcgrid", true)addEventHandler("fillcgrid", root, fillConfGrids)function fillAdminGrids() for i,v in ipairs(rpgroups) do guiGridListSetItemText(groupGrid, guiGridListAddRow(groupGrid), 1, v, false, false) endendaddEvent("fillagrid", true)addEventHandler("fillagrid", root, fillAdminGrids)function close() if (source == closeButton) then guiSetVisible(window, false) showCursor(false) elseif source==name then guiSetText(source,'') endendaddEventHandler("onClientGUIClick", root, close)function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) endendaddEventHandler("onClientGUIClick", root, addThePlayer)function removeThePlayer(thePlayer) if (source==remButton) then triggerServerEvent("addPlayerFromGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) endendaddEventHandler("onClientGUIClick", root, removeThePlayer) now there is no debugscript 3 error but my groups not add selected group and I try restart acl database sql check and still not add sorry for bad english https://prnt.sc/g1dcrk http://prntscr.com/g1dd65 I select unionsoldier members and press add guiedit: admin Edited July 28, 2017 by orcun99 Link to comment
Dimos7 Posted July 28, 2017 Share Posted July 28, 2017 in mysql not connect now idk why Link to comment
orcun99 Posted July 28, 2017 Author Share Posted July 28, 2017 1 minute ago, Dimos7 said: in mysql not connect now idk why there is localhost this is problem? when I restart database have this error but other mysql scripts still work Link to comment
Master_MTA Posted July 28, 2017 Share Posted July 28, 2017 10 minutes ago, orcun99 said: there is localhost this is problem? when I restart database have this error but other mysql scripts still work you should show us your sql script Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now