# Client Side #
addEventHandler("onClientGUIClick",root,
function ()
local sel = guiGridListGetSelectedItem(tabaccountslist)
if source == tabaccountsdelete then
if sel ~= -1 then
local accountName = guiGirdListGetItemText(tabaccountslist,sel,1)
triggerServerEvent("onDeleteAccount",localPlayer,accountName)
else
outputChatBox("Error: You did not select an account",255,0,0)
end
end
end
)
# Server Side #
addEvent("onDeleteAccount",true)
addEventHandler("onDeleteAccount",root,
function (accountName)
local account = getAccount(accountName)
if account then
removeAccount(account)
outputChatBox("INFO: Account Deleted",source,0,255,0)
else
outputChatBox("Error: Account not found",source,255,0,0)
end
end
)