Jump to content

سوال للمبرمجين الكبار .!


Adham

Recommended Posts

جرب التالي :

فكود فتح اللوحة حط ذا الكود

triggerServerEvent("load:Columns",localPlayer,localPlayer)

 

كلينت

addEventHandler ( "onClientGUIClick", root,
    function ( btn )
        if source == GUIEditor.checkbox[1] then
			guiCheckBoxSetSelected ( GUIEditor.checkbox[2], not guiCheckBoxGetSelected ( source ) )
        elseif source == GUIEditor.checkbox[2] then
            guiCheckBoxSetSelected ( GUIEditor.checkbox[1], not guiCheckBoxGetSelected ( source ) )
        end
        if btn == "left" then
            if ( source == GUIEditor.button[1] ) then
				local item = guiComboBoxGetSelected ( com )    
                local card = guiComboBoxGetItemText(com, item)
                local name, email, number = guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), guiGetText ( GUIEditor.edit[3] )
                if name == "" or number == "" or card == "" then return end
				if guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) then
                    triggerServerEvent ( "RentSystem:onCreateNewOrder", localPlayer, localPlayer, name, email, number, card, "classic" )
				elseif guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) then
                    triggerServerEvent ( "RentSystem:onCreateNewOrder", localPlayer, localPlayer, name, email, number, card, "special" )
                end
                guiSetEnabled ( GUIEditor.button[1], false )
            end
        end
	end
)
     
addEvent ( "RentSystem:onSendSubscribePlayers", true )
addEventHandler ( "RentSystem:onSendSubscribePlayers", root,
	function ( tables )
		for i, v in ipairs( tables ) do
			local row = guiGridListAddRow ( GUIEditor.gridlist[4] )
			guiGridListSetItemText( GUIEditor.gridlist[4], row, 2,tables[i].name, false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 1, tables[i].serial , false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 3, tables[i].card, false, false)
		end
	end
)

سيرفر

addEventHandler ("onResourceStart", resourceRoot,
	function () 
		executeSQLQuery ("CREATE TABLE IF NOT EXISTS `Rent_system` (serial,name,email,number,card,plan)")
	end
) 

addEvent ( "load:Columns", true ) 
addEventHandler ( "load:Columns", root,
	function ( player ) 
		local result = executeSQLQuery ( "SELECT * FROM `Rent_System` WHERE `serial` = ?", getPlayerSerial (player) ) 
		if ( result and #result == 0 ) then return end
		triggerClientEvent ( player, "RentSystem:onSendSubscribePlayers", player, result ) 
	end
)

addEvent("RentSystem:onCreateNewOrder",true) 
addEventHandler("RentSystem:onCreateNewOrder",root,
	function ( player, name, email, number, card, plan ) 
		local result = executeSQLQuery ( "SELECT * FROM `Rent_system` WHERE `serial` = ?", getPlayerSerial (player) ) 
		if ( result and #result == 0 ) then 
			executeSQLQuery( 'INSERT INTO `Rent_system` (serial,name,email,number,card,plan) VALUES(?,?,?,?,?,?) ', getPlayerSerial(player), getPlayerName(player), email, number, card, plan )
		else
			outputChatBox("لديك طلب حالياً",player,255,255,255,true)
		end
	end
)  

 

Edited by N3xT
Link to comment

الكود فيه مشاكل

لما بكتب في لايديت وكلو ويجي في القريد لست 

لما اضعط ف10 افتح الوحه يضيف الطلب تاني في القريد لست مدري كيف ض1

ولما ارستر المود او اطلع واخش م يتحفظ الطلب يروح .

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