Jump to content

group panel


orcun99

Recommended Posts

Posted (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 by orcun99

560x95_FFFFFF_FF9900_000000_000000.png

Posted (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 by MrTasty

Previously known as MrTasty.

Posted
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

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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)

 

  • Like 1

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
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

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
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

  • Like 1

560x95_FFFFFF_FF9900_000000_000000.png

Posted
5 minutes ago, orcun99 said:

still don't work erorr: https://prntscr.com/g1cnc3

am so sorry i forgot it 

edit this

  1. local client=getAccountPlayer(clientname)

to this

  1. local client=getAccountPlayer(getAccount(clientname))

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
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

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted (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 by orcun99

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted


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

 

 

Posted
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

560x95_FFFFFF_FF9900_000000_000000.png

Posted
  1. 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)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted (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 by Dimos7

 

 

Posted

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)

 

 

 

Posted (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 by orcun99

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...