السلام عليكم ورحمة الله وبركاته..
عندي مشكلة بالمود ما يحفظ الا اذا سجل من اف8
ابيه يسجل من أي لوحة
يعني لو انا ركبت مود تسجيل دخول وواحد سجل من هناك ما تجي لو سجل من اف8 تجي
ابي لو يسجل من أي مكان او أي لوحة
كلينت
local scX, scY = guiGetScreenSize ( )
local width, height = 439, 408
local offsetX, offsetY = ( scX - width ) / 2, ( scY - height ) / 2
GUIEditor = {
gridlist = {},
window = {},
edit = {},
label = {},
button = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(offsetX, offsetY, width, height, "~# All Registers v1.1 By Dr.anAs#~", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1], false)
GUIEditor.gridlist[1] = guiCreateGridList(20, 53, 399, 260, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.1)
guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.4)
guiGridListAddColumn(GUIEditor.gridlist[1], "Pass", 0.4)
guiGridListAddColumn(GUIEditor.gridlist[1], "Serial", 0.6)
GUIEditor.button[1] = guiCreateButton(409, 23, 20, 20, "X", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000")
GUIEditor.button[2] = guiCreateButton(20, 323, 131, 31, "Change Pass Account", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(161, 323, 131, 31, "Add Account", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(298, 323, 131, 31, "Remove Account", false, GUIEditor.window[1])
GUIEditor.button[5] = guiCreateButton(20, 364, 131, 31, "Refresh", false, GUIEditor.window[1])
GUIEditor.button[6] = guiCreateButton(161, 364, 131, 29, "Change Serial Account", false, GUIEditor.window[1])
GUIEditor.button[7] = guiCreateButton(298, 364, 131, 29, "Copy Info of Account", false, GUIEditor.window[1])
addCommandHandler("Panel_Pass",function()
if ( getPlayerSerial() == "F77D370EB766D26F55412E515564A903" ) then
if ( guiGetVisible(GUIEditor.window[1]) == false ) then
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
guiGridListClear(GUIEditor.gridlist[1])
triggerServerEvent("onGetPass",localPlayer)
else
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
end
end)
addEventHandler("onClientGUIClick",root,function()
local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
local name = guiGridListGetItemText(GUIEditor.gridlist[1],sel,2)
local pass = guiGridListGetItemText(GUIEditor.gridlist[1],sel,3)
if ( source == GUIEditor.button[1] ) then
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
elseif ( source == GUIEditor.button[2] ) then
if ( sel ~= -1 ) then
guiSetVisible(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[2], true)
setElementData(resourceRoot,"NameOfAccount",name)
else
outputChatBox("* Please Select a Account To Change Pass",255,0,0,true)
end
elseif ( source == GUIEditor.button[3] ) then
guiSetVisible(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[3], true)
elseif ( source == GUIEditor.button[4] ) then
if ( sel ~= -1 ) then
triggerServerEvent("onRemoveAccount",localPlayer,name)
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
else
outputChatBox("* Please Select Account To Remove",255,0,0,true)
end
elseif ( source == GUIEditor.button[5] ) then
guiGridListClear(GUIEditor.gridlist[1])
triggerServerEvent("onGetPass",localPlayer)
elseif ( source == GUIEditor.button[6] ) then
if ( sel ~= -1 ) then
guiSetVisible(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[4], true)
setElementData(resourceRoot,"AccountOfSerial",name)
else
outputChatBox("* Please Select a Account To Change Serial",255,0,0,true)
end
elseif ( source == GUIEditor.button[7] ) then
if ( sel ~= -1 ) then
setClipboard("login "..name.." "..pass.."")
outputChatBox("* The Info Was Copy",255,255,0,0,true)
else
outputChatBox("* Please Select a Account To Copy Info",255,0,0,true)
end
end
end)
addEvent("onAdd",true)
addEventHandler("onAdd",root,function(i,name,pass,serial)
local row = guiGridListAddRow (GUIEditor.gridlist[1])
guiGridListSetItemText (GUIEditor.gridlist[1],row,1,i,false,false)
guiGridListSetItemText (GUIEditor.gridlist[1],row,2,name,false,false)
guiGridListSetItemText (GUIEditor.gridlist[1],row,3,pass,false,false)
guiGridListSetItemText (GUIEditor.gridlist[1],row,4,serial,false,false)
end)
GUIEditor.window[2] = guiCreateWindow(270, 201, 302, 146, "Change Pass Account", false)
guiWindowSetSizable(GUIEditor.window[2], false)
guiSetVisible(GUIEditor.window[2], false)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(GUIEditor.window[2],false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(GUIEditor.window[2],x,y,false)
GUIEditor.label[1] = guiCreateLabel(10, 29, 207, 15, "Write a Pass New :", false, GUIEditor.window[2])
GUIEditor.edit[2] = guiCreateEdit(45, 58, 217, 28, "", false, GUIEditor.window[2])
GUIEditor.button[9] = guiCreateButton(268, 24, 20, 20, "X", false, GUIEditor.window[2])
guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFFF0000")
GUIEditor.button[10] = guiCreateButton(78, 101, 149, 28, "Change Pass", false, GUIEditor.window[2])
addEventHandler("onClientGUIClick",root,function ()
if ( source == GUIEditor.button[9] ) then
guiSetVisible(GUIEditor.window[2], false)
showCursor(false)
elseif ( source == GUIEditor.button[10] ) then
local text = guiGetText(GUIEditor.edit[2])
if ( text ~= nil and text ~= "" and text ~= " " ) then
triggerServerEvent("onChangePass",localPlayer,text)
guiSetVisible(GUIEditor.window[2], false)
showCursor(false)
else
outputChatBox("* Write a Password To Change",255,0,0,true)
end
end
end)
GUIEditor.window[3] = guiCreateWindow(229, 194, 343, 273, "Add Accunt", false)
guiWindowSetSizable(GUIEditor.window[3], false)
guiSetVisible(GUIEditor.window[3], false)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(GUIEditor.window[3],false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(GUIEditor.window[3],x,y,false)
GUIEditor.button[11] = guiCreateButton(307, 19, 26, 22, "X", false, GUIEditor.window[3])
guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FFFF0000")
GUIEditor.label[2] = guiCreateLabel(10, 29, 125, 18, "Write Name Account :", false, GUIEditor.window[3])
GUIEditor.edit[3] = guiCreateEdit(79, 57, 189, 28, "", false, GUIEditor.window[3])
GUIEditor.label[3] = guiCreateLabel(10, 91, 144, 16, "Write Password Account :", false, GUIEditor.window[3])
GUIEditor.edit[4] = guiCreateEdit(79, 117, 189, 28, "", false, GUIEditor.window[3])
GUIEditor.button[12] = guiCreateButton(112, 219, 134, 33, "Add Account", false, GUIEditor.window[3])
GUIEditor.label[4] = guiCreateLabel(10, 150, 144, 16, "Write Serial Account :", false, GUIEditor.window[3])
GUIEditor.edit[5] = guiCreateEdit(79, 174, 189, 28, "", false, GUIEditor.window[3])
addEventHandler("onClientGUIClick",root,function()
if ( source == GUIEditor.button[11] ) then
guiSetVisible(GUIEditor.window[3], false)
showCursor(false)
elseif ( source == GUIEditor.button[12] ) then
local nameaccount = guiGetText(GUIEditor.edit[3])
local passaccount = guiGetText(GUIEditor.edit[4])
local serialaccount = guiGetText(GUIEditor.edit[5])
if ( nameaccount ~= nil and nameaccount ~= "" and nameaccount ~= " " ) then
if ( passaccount ~= nil and passaccount ~= "" and passaccount ~= " " ) then
if ( serialaccount ~= nil and serialaccount ~= "" and serialaccount ~= " " ) then
triggerServerEvent("onAddAccount",localPlayer,nameaccount,passaccount,serialaccount)
guiSetVisible(GUIEditor.window[3], false)
showCursor(false)
else
outputChatBox("* Please Write Pass of Account",255,0,0,true)
end
else
outputChatBox("* Please Write Name of Account",255,0,0,true)
end
else
outputChatBox("* Please Write Serial of Account",255,0,0,true)
end
end
end)
GUIEditor.window[4] = guiCreateWindow(220, 168, 360, 147, "Change Serial of Account", false)
guiWindowSetSizable(GUIEditor.window[4], false)
guiSetVisible(GUIEditor.window[4], false)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(GUIEditor.window[4],false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(GUIEditor.window[4],x,y,false)
GUIEditor.label[5] = guiCreateLabel(10, 28, 170, 16, "Write Serial New Of Account :", false, GUIEditor.window[4])
GUIEditor.edit[6] = guiCreateEdit(71, 61, 227, 28, "", false, GUIEditor.window[4])
GUIEditor.button[13] = guiCreateButton(118, 109, 125, 28, "Change Serial", false, GUIEditor.window[4])
GUIEditor.button[14] = guiCreateButton(327, 28, 23, 23, "X", false, GUIEditor.window[4])
guiSetProperty(GUIEditor.button[14], "NormalTextColour", "FFFF0000")
addEventHandler("onClientGUIClick",root,function()
if ( source == GUIEditor.button[13] ) then
local theserial = guiGetText(GUIEditor.edit[6])
if ( theserial ~= nil and theserial ~= "" and theserial ~= " " ) then
triggerServerEvent("onChangeSerial",localPlayer,theserial)
guiSetVisible(GUIEditor.window[4], false)
showCursor(false)
else
outputChatBox("* Please Write a Serial To Change",255,0,0,true)
end
elseif ( source == GUIEditor.button[14] ) then
guiSetVisible(GUIEditor.window[4], false)
showCursor(false)
end
end)
end
)
سيرفر
getAccounts = function()
local Row = executeSQLQuery("SELECT * FROM Admin")
if (type(Row) == "table" and #Row == 0) or not Row then
return {}
else
return Row
end
end
addEvent("onGetPass",true)
addEventHandler("onGetPass",root,function ()
for i,v in ipairs (getAccounts()) do
triggerClientEvent(source,"onAdd",source,i,v.name,v.pass,v.serial)
end
end)
addEvent("onChangePass",true)
addEventHandler("onChangePass",root,function(thePass)
setAccountPassword(getAccount(getElementData(resourceRoot,"NameOfAccount")),thePass)
executeSQLQuery("UPDATE Admin SET pass = ? WHERE name = ?",thePass,getElementData(resourceRoot,"NameOfAccount"))
outputChatBox("* ".. getElementData(resourceRoot,"NameOfAccount") .." Change Pass To ".. thePass .." !",source,255,0,0,true)
end)
addEvent("onAddAccount",true)
addEventHandler("onAddAccount",root,function(name,pass,serial)
if ( getAccount(name) ) then return outputChatBox("* Account with this name already exists.",source,255,0,0,true) end
addAccount (name,pass)
executeSQLQuery("INSERT INTO Admin(name,pass,serial) VALUES(?,?,?)", name, pass, serial)
outputChatBox("* You Will Add Account With Name ".. name .." and Password ".. pass .."",source,255,255,0,true)
end)
addEvent("onRemoveAccount",true)
addEventHandler("onRemoveAccount",root,function(theName)
removeAccount(getAccount(theName))
executeSQLQuery("DELETE FROM Admin WHERE name=?", theName)
outputChatBox("* You Will Remove Account ".. theName .." !",source,255,0,0,true)
end)
addEvent("onChangeSerial",true)
addEventHandler("onChangeSerial",root,function(theSerial)
setAccountData(getAccount(getElementData(resourceRoot,"AccountOfSerial")),"xSerial",theSerial)
executeSQLQuery("UPDATE Admin SET serial = ? WHERE name = ?",theSerial,getElementData(resourceRoot,"AccountOfSerial"))
outputChatBox("* Change Serial of Account ".. getElementData(resourceRoot,"AccountOfSerial") .." 100% !",source,255,0,0,true)
end)