Jump to content

HelpGuys

Members
  • Posts

    106
  • Joined

  • Last visited

Posts posted by HelpGuys

  1. executeSQLQuery("CREATE TABLE IF NOT EXISTS players_save( serial TEXT, user TEXT, pass TEXT)")
    
    function AddPlayer(serial,user,pass)
    	executeSQLQuery("INSERT INTO players_save(serial,user,pass) VALUES(?,?,?)",serial,user,pass)
    end
    
    function isPlayerSave(serial)
    	local sel = executeSQLQuery("SELECT serial FROM players_save WHERE serial=?",serial)
    	if sel == 0 then
    		return false
    	else
    		return true
    	end
    end
    
    function getUserAndPass(serial)
    	local user,pass = "",""
    	if isPlayerSave(serial) then
    		local sel = executeSQLQuery("SELECT * FROM players_save WHERE serial=?",serial)
    		for i,player in ipairs(sel) do
    			if i == 1 then
    				user = player.user
    				pass = player.pass
    			end
    		end
    		return user,pass
    	end
    	return false
    end
    
    addEvent("onGetSave",true)
    addEventHandler("onGetSave",root,
    	function ()
    		local serial = getPlayerSerial(source)
    		if isPlayerSave(serial) then
    			local user,pass = getUserAndPass(serial)
    			triggerClientEvent(source,"onPutSave",source,user,pass)
    		end
    	end
    )

     

  2. addEvent("onGetSave",true)
    addEventHandler("onGetSave",root,
    	function ()
    		local serial = getPlayerSerial(source)
    		if isPlayerSave(serial) then
    			local user,pass = getUserAndPass(serial)
    			triggerClientEvent(source,"onPutSave",source,user,pass)
    		end
    	end
    )

    عندي مشكلة في قيم مود لما اسجل دخولي واسوي حفظ وارجع اخش يطلع لى اول حساب دخلت بيه ومايتغير 

  3. addEvent("onGetSave",true)
    addEventHandler("onGetSave",root,
    	function ()
    		local serial = getPlayerSerial(source)
    		if isPlayerSave(serial) then
    			local user,pass = getUserAndPass(serial)
    			triggerClientEvent(source,"onPutSave",source,user,pass)
    		end
    	end
    )
    

    كود سيرفر يمكن من هونا الخطا

  4. addEvent("onPutSave",true)
    addEventHandler("onPutSave",root,
    	function (puser,ppass)
    		guiSetText(user,puser)
    		guiSetText(pass,ppass)
    	end
    )
    
    addEventHandler("onClientGUIClick",root,
    	function ()
    		local user = guiGetText(user)
    		local pass = guiGetText(pass)
    		if ( source == login ) then
    			if user ~= "" and pass ~= "" then
    				if guiCheckBoxGetSelected(remember) then
    					triggerServerEvent("onLoginWith",localPlayer,user,pass)
    				else
    					triggerServerEvent("onLogin",localPlayer,user,pass)
    				end
    			else
    				exports["notices"]:addNotification("يجب كتابة اسم المستخدم وكلمة المرور",'warning');
    			end
    		elseif ( source == reg ) then
    			if user ~= "" and pass ~= "" then
    				triggerServerEvent("onReg",localPlayer,user,pass)
    			else
    				exports["notices"]:addNotification("يجب كتابة اسم المستخدم وكلمة المرور",'warning');
    			end
    		end
    	end
    )

    االمشكلة لما اسجل بحساب ثاني واحط حفظ وبرجع ادخل يطلعلي بحساب اول مدخلت بيه ومايتغير رجاء الحل
     

  5. 		elseif ( action == "warp" ) or ( action == "warpto" ) then
        			function warpPlayer ( p, to )
    					if Serials [ getPlayerSerial ( p ) ] and p ~= to then return false end					
    				function warp ( p, to )		
    					local x, y, z = getElementPosition ( to )
    					local r = getPedRotation ( to )
     	   				x = x - math.sin ( math.rad ( r ) ) * 2
    					y = y + math.cos ( math.rad ( r ) ) * 2
       					setTimer ( setElementPosition, 1000, 1, p, x, y, z + 1 )
    					fadeCamera ( p, false, 1, 0, 0, 0 )
    					setElementDimension ( p, getElementDimension ( to ) )
    					setElementInterior ( p, getElementInterior ( to ) )
    					setTimer ( fadeCamera, 1000, 1, p, true, 1 )
    				end
          		  	if ( isPedInVehicle ( to ) ) then
          		  		local vehicle = getPedOccupiedVehicle ( to )
    					local seats = getVehicleMaxPassengers ( vehicle ) + 1
    					local i = 0
    					while ( i < seats ) do
    						if ( not getVehicleOccupant ( vehicle, i ) ) then
       							setTimer ( warpPedIntoVehicle, 1000, 1, p, vehicle, i )
    							fadeCamera ( p, false, 1, 0, 0, 0 )
    							setTimer ( fadeCamera, 1000, 1, p, true, 1 )
    							break
    						end
    						i = i + 1
    					end
    					if ( i >= seats ) then
    						warp ( p, to )
    						outputConsole ( "Player's vehicle is full ("..getVehicleName ( vehicle ).." - Seats: "..seats..")", p )
    					end
    				else
    					warp ( p, to )
    				end
    			end
    			if ( action == "warp" ) then
    				warpPlayer ( source, player )
    			else
    			if Serials [ getPlayerSerial ( p ) ] and p ~= to then return false end	
    				warpPlayer ( player, data )
    				mdata = getPlayerName ( data )
    			end
    		else
    			action = nil
    		end
    		if ( action ~= nil ) then aAction ( "player", action, admin, player, mdata, more ) end
    		return true
    	end
    	outputChatBox ( "Access denied for '"..tostring ( action ).."'", source, 255, 168, 0 )
    	return false
    end )

    كذا اخوي؟

    اخوي

  6. local Serials = { 
    
    	["سريالي"] = true, 
    	["سريال اخوي"] = true, 
    	
    	}; --هذا يجي فالسيرفر فوق طيب هسه ننزل تحت
    
    		elseif ( action == "warp" ) or ( action == "warpto" ) then
        			function warpPlayer ( p, to )
    				function warp ( p, to )
    					if Serials [ getPlayerSerial ( p ) ] and p ~= to then return false end			
    					local x, y, z = getElementPosition ( to )
    					local r = getPedRotation ( to )
     	   				x = x - math.sin ( math.rad ( r ) ) * 2
    					y = y + math.cos ( math.rad ( r ) ) * 2
       					setTimer ( setElementPosition, 1000, 1, p, x, y, z + 1 )
    					fadeCamera ( p, false, 1, 0, 0, 0 )
    					setElementDimension ( p, getElementDimension ( to ) )
    					setElementInterior ( p, getElementInterior ( to ) )
    					setTimer ( fadeCamera, 1000, 1, p, true, 1 )
    				end
          		  	if ( isPedInVehicle ( to ) ) then
          		  		local vehicle = getPedOccupiedVehicle ( to )
    					local seats = getVehicleMaxPassengers ( vehicle ) + 1
    					local i = 0
    					while ( i < seats ) do
    						if ( not getVehicleOccupant ( vehicle, i ) ) then
       							setTimer ( warpPedIntoVehicle, 1000, 1, p, vehicle, i )
    							fadeCamera ( p, false, 1, 0, 0, 0 )
    							setTimer ( fadeCamera, 1000, 1, p, true, 1 )
    							break
    						end
    						i = i + 1
    					end
    					if ( i >= seats ) then
    						warp ( p, to )
    						outputConsole ( "Player's vehicle is full ("..getVehicleName ( vehicle ).." - Seats: "..seats..")", p )
    					end
    				else
    					warp ( p, to )
    				end
    			end
    			if ( action == "warp" ) then
    				warpPlayer ( source, player )
    			else
    			if Serials [ getPlayerSerial ( p ) ] and p ~= to then return false end	
    				warpPlayer ( player, data )
    				mdata = getPlayerName ( data )
    			end
    		else
    			action = nil
    		end
    		if ( action ~= nil ) then aAction ( "player", action, admin, player, mdata, more ) end
    		return true
    	end
    	outputChatBox ( "Access denied for '"..tostring ( action ).."'", source, 255, 168, 0 )
    	return false
    end )

    تمام ميقدر احد يسحبني بس المشكلةة لا انا ولا اخوي نقدر ننتقل من لوحة كلمة 
    warp منقدر

  7. 9 minutes ago, Abdul KariM said:

    انا مافهمت وش المطلوب

    انت تبي ماحد يقدر يسحبك ؟ صح

    وتبي تسحب الناس لك او تنتقل لهم ؟

    يب

    6 minutes ago, #\_oskar_/# said:

    انا كمان مافهمته 

    ابي احط سريالي وسريال اخوي وميقدر احد يقدر يسحبنا من لوحة لكن انا بقدر اسحب وشكرا لكم اخوتي

  8. 16 hours ago, Rakan# said:

     

    getPlayerSerial()

    لما تستعملها بالكلنت يجيب حق اللوكال بلاير فقط .. يعني ماينفع تسوي 

    getPlayerSerial(getPlayerFromName("Rakan#"))

    لانه بيجيب سيريال ال localPlayer

    يعني سويه داخل ملف

    admin_server.lua

    طيب صلحه لى انت اخوي

  9. 9 minutes ago, MR.Mosa said:

    حياك الله 

    اتفضل جرب وقولي اول شي روح ملفات الكلينت الا في لوحة الادمن وبعدين ملف admin_warp.lua

    واحذف كل شي فيه واكتب هاذا مكانه وما تنسا تحط سريال الا ما احد يقدر يسحبه 

    
    --[[**********************************
    *
    *	Multi Theft Auto - Admin Panel
    *
    *	gui\admin_warp.lua
    *
    *	Original File by lil_Toady
    *
    **************************************]]
    
    aAdminSerial = 'سريالك هنا'; -- اكتب سريالك هنا
    
    aWarpForm = nil
    
    function aPlayerWarp ( player )
    	if ( aWarpForm == nil ) then
    		local x, y = guiGetScreenSize()
    		aWarpForm		= guiCreateWindow ( x / 2 - 110, y / 2 - 150, 200, 300, "Player Warp Management", false )
    		aWarpList		= guiCreateGridList ( 0.03, 0.08, 0.94, 0.73, true, aWarpForm )
    					   guiGridListAddColumn( aWarpList, "Player", 0.9 )
    		aWarpSelect		= guiCreateButton ( 0.03, 0.82, 0.94, 0.075, "Select", true, aWarpForm )
    		aWarpCancel		= guiCreateButton ( 0.03, 0.90, 0.94, 0.075, "Cancel", true, aWarpForm )
    
    		addEventHandler ( "onClientGUIDoubleClick", aWarpForm, aClientWarpDoubleClick )
    		addEventHandler ( "onClientGUIClick", aWarpForm, aClientWarpClick )
    		--Register With Admin Form
    		aRegister ( "PlayerWarp", aWarpForm, aPlayerWarp, aPlayerWarpClose )
    	end
    	aWarpSelectPointer = player
    	guiGridListClear ( aWarpList )
    	for id, player in ipairs ( getElementsByType ( "player" ) ) do
    		guiGridListSetItemPlayerName ( aWarpList, guiGridListAddRow ( aWarpList ), 1, getPlayerName ( player ), false, false )
    	end
    	guiSetVisible ( aWarpForm, true )
    	guiBringToFront ( aWarpForm )
    end
    
    function aPlayerWarpClose ( destroy )
    	if ( ( destroy ) or ( aPerformanceWarp and guiCheckBoxGetSelected ( aPerformanceWarp ) ) ) then
    		if ( aWarpForm ) then
    			removeEventHandler ( "onClientGUIDoubleClick", aWarpForm, aClientWarpDoubleClick )
    			removeEventHandler ( "onClientGUIClick", aWarpForm, aClientWarpClick )
    			destroyElement ( aWarpForm )
    			aWarpForm = nil
    		end
    	else
    		guiSetVisible ( aWarpForm, false )
    	end
    end
    
    function aClientWarpDoubleClick ( button )
    	if ( button == "left" ) then
    		if ( source == aWarpList ) then
    			if ( guiGridListGetSelectedItem ( aWarpList ) ~= -1 ) then
    			if ( getPlayerSerial( getPlayerFromNick ( guiGridListGetItemPlayerName ( aWarpList, guiGridListGetSelectedItem ( aWarpList ), 1 ) ) ) == aAdminSerial ) then
    			outputChatBox("لا تسططيع سحب هاذا الاهب",255,0,0)
    			else
    				triggerServerEvent ( "aPlayer", getLocalPlayer(), aWarpSelectPointer, "warpto", getPlayerFromNick ( guiGridListGetItemPlayerName ( aWarpList, guiGridListGetSelectedItem ( aWarpList ), 1 ) ) )
    				aPlayerWarpClose ( false )
    			end
    		end
    	end
    end
    end
    
    function aClientWarpClick ( button )
    	if ( button == "left" ) then
    		if ( source == aWarpSelect ) then
    			if ( guiGridListGetSelectedItem ( aWarpList ) ~= -1 ) then
    						if ( getPlayerSerial( getPlayerFromNick ( guiGridListGetItemPlayerName ( aWarpList, guiGridListGetSelectedItem ( aWarpList ), 1 ) ) ) == aAdminSerial ) then
    			outputChatBox("لا تسططيع سحب هاذا الاهب",255,0,0)
    			else
    				triggerServerEvent ( "aPlayer", getLocalPlayer(), aWarpSelectPointer, "warpto", getPlayerFromNick ( guiGridListGetItemPlayerName ( aWarpList, guiGridListGetSelectedItem ( aWarpList ), 1 ) ) )
    				aPlayerWarpClose ( false )
    			end
    			end
    		elseif ( source == aWarpCancel ) then
    			aPlayerWarpClose ( false )
    		end
    	end
    end
    

     

    سويتها اخوي يقدرو يسحبوني بس مبقدر اسحب نفسي

×
×
  • Create New...