Jump to content

ايدت بوكس البحث


#Major .

Recommended Posts

السلام عليكم انا مسوي لوحة قريد ليست ورابطها ب sql

ومسوي ايدت بوكس للبحث

م عرفت شلون ابرمج الايدت بوكس انه يبحث بين الاعبين

مع العلم ان القريد ليست منربط ب قاعدة بيانات وفيها 4 كولمنات :) ابيه يبحث عن طريق الاسم ؟

Link to comment
3 minutes ago, #\_oskar_/# said:

اطرح اللوب اسويه لك 

هذاا الكلانت حق الوحة


addEventHandler("onClientResourceStart", resourceRoot,
    function()
local screenW, screenH = guiGetScreenSize()
        acc2 = guiCreateWindow((screenW - 611) / 2, (screenH - 434) / 2, 611, 434, "Account Panel Admin", false)
        guiWindowSetSizable(acc2, false)
		guiSetVisible(acc2, false)
        bh = guiCreateEdit(46, 24, 555, 20, "", false, acc2)
        image = guiCreateStaticImage(10, 24, 27, 20, "aliradoy.png", false, acc2)
        Grid = guiCreateGridList(9, 55, 592, 324, false, acc2)
        guiGridListAddColumn(Grid, "#Nick", 0.3)
        guiGridListAddColumn(Grid, "Username", 0.3)
        guiGridListAddColumn(Grid, "Password", 0.3)
        colmse = guiGridListAddColumn(Grid, "Sreial", 0.9) 
		
        Close = guiCreateButton(256, 389, 107, 35, "Close", false, acc2)
        guiSetFont(Close, "default-bold-small")
        guiSetProperty(Close, "NormalTextColour", "FFFE0018")    		
        Remove = guiCreateButton(496, 389, 107, 335, "Remove Account", false, acc2)
        guiSetFont(Remove, "default-bold-small")
        guiSetProperty(Remove, "NormalTextColour", "FFFE0018")
        Copy = guiCreateButton(136, 389, 107, 135, "Copy my Account", false, acc2)
        guiSetFont(Copy, "default-bold-small")
        guiSetProperty(Copy, "NormalTextColour", "FFFE0018") 
        Refresh = guiCreateButton(16, 389, 107, 135, "Refresh", false, acc2)
        guiSetFont(Refresh, "default-bold-small")
        guiSetProperty(Refresh, "NormalTextColour", "FFFE0018")
        ChangePass = guiCreateButton(380, 389, 107, 135, "Change Pass Account", false, acc2)
        guiSetFont(ChangePass, "default-bold-small")
        guiSetProperty(ChangePass, "NormalTextColour", "FFFE0018")	
    end
)
addEventHandler("onClientResourceStart", resourceRoot,
    function()
local screenW, screenH = guiGetScreenSize()
accp = guiCreateWindow((screenW - 435) / 2, (screenH - 149) / 2, 435, 149, "Change Pass Account", false)
        guiWindowSetSizable(accp, false)
		guiSetVisible(accp, false)
        label_pass = guiCreateLabel(-47, 65, 172, 20, "Write a Pass New :", false, accp)
        guiSetFont(label_pass, "default-bold-small")
        guiLabelSetColor(label_pass, 2, 31, 251)
        guiLabelSetHorizontalAlign(label_pass, "right", false)
        passedit = guiCreateEdit(130, 63, 236, 22, "", false, accp)
        CloseP = guiCreateButton(399, 119, 26, 20, "X", false, accp)
        guiSetFont(CloseP, "default-bold-small")
        guiSetProperty(CloseP, "NormalTextColour", "FFFE0000")
        Change = guiCreateButton(164, 119, 107, 20, "Change Pass", false, accp)
        guiSetFont(Change, "default-bold-small")
        guiSetProperty(Change, "NormalTextColour", "FF04F804") 	
end)

addCommandHandler("acc2",
function()
triggerServerEvent("CheckACL2",getLocalPlayer())
triggerServerEvent("refresh3",getLocalPlayer())
end
)





addEvent("showpanel2", true)
addEventHandler("showpanel2",root,
function()
if ( guiGetVisible(acc2) == false ) then
guiSetVisible(acc2, true)
showCursor(true)
triggerServerEvent("refresh3",getLocalPlayer())
else
guiSetVisible(acc2, false)
showCursor(false)
		end
	end
)
addEventHandler ("onClientGUIClick", root,
        function()
		local sel = guiGridListGetSelectedItem(Grid)
		local Username = guiGridListGetItemText(Grid,sel,2)
		local Password = guiGridListGetItemText(Grid,sel,3)
		if ( source == Remove ) then
		if ( sel ~= -1 ) then
		triggerServerEvent("onRemoveAccount",localPlayer,Username)
		guiSetVisible(acc2, false)
		showCursor(false)
		else
		outputChatBox("* Please Select Account To Remove",255,0,0,true)
		end
		elseif ( source == Copy ) then
		if ( sel ~= -1 ) then
		setClipboard("login "..Username.." "..Password.."")
		outputChatBox("* The Info Was Copy",255,255,0,0,true)
		else
		outputChatBox("* Please Select a Account To Copy Info",255,0,0,true)
		end
		elseif ( source == ChangePass ) then
		if ( sel ~= -1 ) then
		guiSetVisible(acc2, false)
		guiSetVisible(accp, true)
		setElementData(resourceRoot,"NameOfAccount",Username)
		else
		outputChatBox("* Please Select a Account To Change Pass",255,0,0,true)
		end
	end
end
)




addEventHandler ("onClientGUIClick", root,
        function()
		if (source == Close) then
		outputChatBox("#aa0000[#d0d0d0 Login Panel System #aa0000] #d0d0d0By #aa0000[#d0d0d0 *Rayan-Alharbi#aa0000 ]",0,0,0,true)
		guiSetVisible(acc2, false)
		showCursor(false)
		guiSetEnabled(Close, false)
		setTimer(function()
		guiSetEnabled(Close, true)
		end,3000,1)
		elseif ( source == Refresh ) then
		guiGridListClear(Grid)
       triggerServerEvent("refresh3",getLocalPlayer())

		end
	end
)
		
		addEventHandler("onClientGUIClick",root,function ()
		if ( source == CloseP ) then
		guiSetVisible(accp, false)
		showCursor(false)
		elseif ( source == Change ) then
		local text = guiGetText(passedit)
		if ( text ~= nil and text ~= "" and text ~= " " ) then
		triggerServerEvent("onChangePass",localPlayer,text)
		guiSetVisible(accp, false)
		showCursor(false)
		else
		outputChatBox("* Write a Password To Change",255,0,0,true)
		end
	
	end

		end)


addEvent ( "refresh1" , true ) 
addEventHandler ( "refresh1" , root , function ( sql ) 
guiGridListClear ( Grid ) 
for k,v in ipairs ( sql ) do 
local row = guiGridListAddRow ( Grid ) ; 
guiGridListSetItemText ( Grid , row , 1 , v['PlayerName'] , false , false ) ; 
guiGridListSetItemText ( Grid , row , 2 , v['Username'] , false , false ) ; 
guiGridListSetItemText ( Grid , row , 3 , v['Password'] , false , false ) ; 
guiGridListSetItemText ( Grid , row , 4 , v['PlayerSerial'] , false , false ) ; 
end
end ) ;

 

Link to comment
1 hour ago, #\_oskar_/# said:

محاولتك ؟

function players (    )
    guiGridListClear ( Grid )
    for _,v in ipairs ( getElementsByType ( "player" ) ) do
    local Row = guiGridListAddRow ( Grid)  
    guiGridListSetItemText ( Grid, Row, 1, getPlayerName ( v ), false, false )
    end
    end



addEventHandler("onClientGUIChanged",root,
	function ()
		if ( source == NAME ) then
			local text = string.upper(guiGetText(NAME))
			if ( text == "" ) then  
			else
				guiGridListClear(Grid)
				for i,v in ipairs(getElementsByType("player")) do
					local name = string.upper(getPlayerName(v))
					if string.find(name,text) then
					playSoundFrontEnd(3)
						local row = guiGridListAddRow(Grid)
						guiGridListSetItemText(Grid,row,1,getPlayerName(v),false,false)
						guiGridListSetItemColor(Grid,row,1,255,100,100)
						guiSetProperty(NAME, "NormalTextColour", "FF0048FF")
						else
						guiSetProperty(NAME, "NormalTextColour", "FFFF0000")
					end
				end
			end
		end
	end
)

 

1- يجيب اللاعبين الموجودين فقط

2- لما تبحث عن اسم يجيبه لحاله بدون الكولمنات الثانيه

Link to comment

: جرب تعدل علي الكود دا

guiGridListClear(GridList) 
for i, v in ipairs(getElementsByType"player") do 
    if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), string.lower(guiGetText(source))) then 
        guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 1, tostring(i), false, false) 
        guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 2, getPlayerName(v), false, false) 
    end 
end 

تعدل عليه = تغير الأسماء ان شاء الله يشتغل ;)

Link to comment
8 hours ago, MrKAREEM said:

: جرب تعدل علي الكود دا


guiGridListClear(GridList) 
for i, v in ipairs(getElementsByType"player") do 
    if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), string.lower(guiGetText(source))) then 
        guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 1, tostring(i), false, false) 
        guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 2, getPlayerName(v), false, false) 
    end 
end 

تعدل عليه = تغير الأسماء ان شاء الله يشتغل ;)

م زبط

addEventHandler("onClientGUIChanged",root,
	function ()
		if ( source == NAME ) then
			local text = string.upper(guiGetText(NAME))
			if ( text == "" ) then  
			else
				guiGridListClear(Grid) 
			for i, v in ipairs(getElementsByType"player") do 
			if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), string.lower(guiGetText(NAME))) then 
        guiGridListSetItemText(Grid, guiGridListAddRow(Grid), 1, tostring(i), false, false) 
        guiGridListSetItemText(Grid, guiGridListAddRow(Grid), 2, getPlayerName(v), false, false) 

						guiSetProperty(NAME, "NormalTextColour", "FF0048FF")
						else
						guiSetProperty(NAME, "NormalTextColour", "FFFF0000")
					end
				end
			end
		end
	end
)

+

 انت مفهمت قصدي انا ابيه يبحث من داخل قاعدة البيانات مو بين الاعبين المتواجدين

Edited by *RayaN-Alharbi.
Link to comment

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...