al-Kobra Posted January 4, 2014 Share Posted January 4, 2014 تقصد انك تبي تسوي سياره على سريال اللاعب واذا سويت ريستارت ترجع السياره مكانها؟ هو يقصد ان كتب السيريال في ايدت ,, بعدين السيارة تنحفظ على السيريال الا كتبه في الايدت Link to comment
فاّرس Posted January 4, 2014 Share Posted January 4, 2014 فاهم بس اقصد هو يبيها اذا صار ريستارت للمود ترجع السيارات؟ Link to comment
Mr-M3AND Posted January 4, 2014 Author Share Posted January 4, 2014 تقصد انك تبي تسوي سياره على سريال اللاعب واذا سويت ريستارت ترجع السياره مكانها؟ ابيها تكون محفوظة بالقريد ليست للاعب صاحب السيريال وماتروح لين هو يمسحها يعني حطيت السيريال وصنعت السيارة ابيها تروح للوحة القريد ليست للاعب صاحب السيريال وتنحفظ هناك وحتى لو سويت ريستارت تبقى مكانها Link to comment
EH10 Posted January 4, 2014 Share Posted January 4, 2014 انت قصدك مثال : ؟ اذا شريت سياره تجي في القريد ليست وتنحفظ بسيريالك ؟ Link to comment
Mr-M3AND Posted January 4, 2014 Author Share Posted January 4, 2014 انت قصدك مثال : ؟اذا شريت سياره تجي في القريد ليست وتنحفظ بسيريالك ؟ لا Link to comment
Booo Posted January 4, 2014 Share Posted January 4, 2014 لا انت الحين حدد الي تبيه بالضبط علشان نقددر نساعدك تبي تحفظ البيانات بـ xml والا سقل او وش تبي بالضبط علشان نضبط كؤدك Link to comment
EH10 Posted January 4, 2014 Share Posted January 4, 2014 انت قصدك مثال : ؟اذا شريت سياره تجي في القريد ليست وتنحفظ بسيريالك ؟ لا قصدك انت عندك لوحة خاصة وتفتح المود وتنصنع سياره تكتب السريال ورقم السياره وتجي بالقريد ليست ورايعها بس هو يقدر يطلعها ويخفيها ؟ Link to comment
Mr-M3AND Posted January 4, 2014 Author Share Posted January 4, 2014 انت قصدك مثال : ؟اذا شريت سياره تجي في القريد ليست وتنحفظ بسيريالك ؟ لا قصدك انت عندك لوحة خاصة وتفتح المود وتنصنع سياره تكتب السريال ورقم السياره وتجي بالقريد ليست ورايعها بس هو يقدر يطلعها ويخفيها ؟ يب السيارة تروح للوحة اللاعب صاحب السسيريال يعني حطيت سيريالك بالايديت وصنعت السيارة كذا ابيها تروح للوحتك انت بس وتنحفظ على طول لين انت تحذفها من لوحة القريد ليست حقتك كذا اعتقد ان كلامي واضح Link to comment
فاّرس Posted January 4, 2014 Share Posted January 4, 2014 الي فهمته انك تبي تسوي سيارة على سريال اي لاعب وتكون محفوظه بالجريد عند اسمه صح ولا لا .؟ وكيف هو بيحذفها؟ واذا حذفها تروح السيارة حقه؟ Link to comment
Mr-M3AND Posted January 4, 2014 Author Share Posted January 4, 2014 الي فهمته انك تبي تسوي سيارة على سريال اي لاعب وتكون محفوظه بالجريد عند اسمه صح ولا لا .؟وكيف هو بيحذفها؟ واذا حذفها تروح السيارة حقه؟ كلامك مضبوط ومن ناحيه انه كيف يحذفها احط له زر يسوي دستروي كار بس وخلاص تختفي السيارة Link to comment
#DRAGON!FIRE Posted January 4, 2014 Share Posted January 4, 2014 الي فهمته انك تبي تسوي سيارة على سريال اي لاعب وتكون محفوظه بالجريد عند اسمه صح ولا لا .؟وكيف هو بيحذفها؟ واذا حذفها تروح السيارة حقه؟ كلامك مضبوط ومن ناحيه انه كيف يحذفها احط له زر يسوي دستروي كار بس وخلاص تختفي السيارة اعتقد ما احد يسويها لك لأنه يبيلها حفظ وحذف ومدري وش الاحسن تتعلم بـ نفسك والموضوع ذا يساعدك ويعلمك : viewtopic.php?f=164&t=56729 ولأ تنسى تركز بـ الششرح . Link to comment
Mr-M3AND Posted January 5, 2014 Author Share Posted January 5, 2014 طيب سويته وضبط صار يحفظ وسويت كود عشان احذفه من القريد ليست ولكن في مشكلة لما احذفه ينحذف ولما اسوي ريستارت يرجع زي اول يعني ماانحذف :: Client addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor_Button[1] ) then local name = guiGetText(GUIEditor_Edit[1]) local x, y, z = guiGetText(GUIEditor_Edit[2]),guiGetText(GUIEditor_Edit[3]),guiGetText(GUIEditor_Edit[4]) local carID = guiGetText(GUIEditor_Edit[5]) local carName = getVehicleNameFromModel ( tonumber ( carID ) ) triggerServerEvent("Save",localPlayer, x, y, z,carID, carName) end end ) addEventHandler("onClientGUIClick",GUIEditor_Button[2], function () local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if guiGridListGetSelectedItem( GUIEditor_Grid[1]) == -1 then return end triggerServerEvent("RemoveRow",localPlayer,carName,row) end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow" ,root, function ( carName ) guiGridListRemoveRow (GUIEditor_Grid[1], tostring( carName ) ) end ) addEvent ( "AddDataCarName", true ) addEventHandler ( "AddDataCarName", root, function (carName ) local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, 1,tostring ( carName ), false, false ) end ) addEvent ( "AddCarName", true ) addEventHandler ( "AddCarName", root, function ( onClientSqlList) guiGridListClear ( GUIEditor_Grid[1] ) for _, v in ipairs ( onClientSqlList ) do row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring ( v.carName ), false, false ) end end ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "Refresh", localPlayer ) end ) :: Server addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS `SQL_Data` (`carName`)" ) outputDebugString("SQL Data Base Started!",0,0,255,0,0) end ) function setSQL_Data ( carName ) return executeSQLQuery ( "INSERT INTO `SQL_Data` ( `carName` ) VALUES ( ? )",tostring(carName)) end function SelectFromSql ( ) local data = executeSQLQuery ( "SELECT * FROM `SQL_Data`" ) if ( type ( data ) == "table" and #data == 0) or not data then return { } else return data; end end function UpDateListInSql ( element ) if ( not isElement ( element ) ) then return; end local Upsql = SelectFromSql ( ) triggerClientEvent ( element, "AddCarName", element, Upsql ) end addEvent ( "Save", true ) addEventHandler ( "Save", root, function ( x, y, z, carID,carName ) local Car = createVehicle ( carID, x, y, z ) setSQL_Data ( carName); triggerClientEvent ( root, "AddDataCarName", root,carName ) end ) addEvent("RemoveRow", true) addEventHandler("RemoveRow", root, function(row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `carName` = ? ", tostring(carName) ) then triggerClientEvent("DeleteRow",root, row) end end ) addEvent ( "Refresh", true ) addEventHandler ( "Refresh", root, function ( ) UpDateListInSql ( source ) end ) Link to comment
iPrestege Posted January 6, 2014 Share Posted January 6, 2014 Copy - Paste من السكربت تبعـي حق الـسيرفرات .. و التنقل بيـنهــم Link to comment
Mr-M3AND Posted January 6, 2014 Author Share Posted January 6, 2014 Copy - Paste من السكربت تبعـي حق الـسيرفرات .. و التنقل بيـنهــم https://forum.multitheftauto.com/viewtopic.php?f=160&p=546902 Link to comment
iPrestege Posted January 6, 2014 Share Posted January 6, 2014 addEventHandler("onClientGUIClick",GUIEditor_Button[2], function () local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if guiGridListGetSelectedItem( GUIEditor_Grid[1]) == -1 then return end triggerServerEvent("RemoveRow",localPlayer,carName,row) end ) من بداية سطر 14 لو تلاحظ : triggerServerEvent("RemoveRow",localPlayer,carName,row) carName = غير معــــرفــــــه .. هذا سكربت سويتة قبل سنة تقريباً تقدر تستفيد منة نفس طريقتك بس ركز يبي لة فهم زين وش العمود اللي تبي تحذفة وين اللي مختارة ادرسة زين ذذ : ---------------------- -- This Script -- Scripted By -- Mr.Pres[T]ege -- Mail : [email protected] -- Main : [email protected] -- Skype : Mr.PresTege -- [url=http://www.gta-arabs.com]www.gta-arabs.com[/url] ---------------------- local Key = "F10" Panel = { gridlist = {}, button = {}, label = {}, edit = {}, Window = {}, } local rIP local rPort local rName time = 15 --- time count - default : 10 seconds function centerWindow(center_window,i,v) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/i,(screenH-windowH)/v guiSetPosition(center_window,x,y,false) end Panel.Window[1] = guiCreateWindow(37, 109, 420, 358, "==[ التحكم في التحويل بين الرومات ]==", false) centerWindow(Panel.Window[1],2,2) guiSetVisible(Panel.Window[1],false) guiWindowSetSizable(Panel.Window[1], false) guiSetAlpha(Panel.Window[1], 1.00) guiSetProperty(Panel.Window[1], "CaptionColour", "FFEFFF00") Panel.gridlist[1] = guiCreateGridList(9, 21, 402, 278, false, Panel.Window[1]) guiGridListAddColumn(Panel.gridlist[1], "اسم الروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "آي بي الروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "البورت للروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "نوع اللعب #", 0.2) Panel.button[1] = guiCreateButton(11, 311, 114, 29, "التحويل للروم", false, Panel.Window[1]) guiSetFont(Panel.button[1], "default-bold-small") guiSetProperty(Panel.button[1], "NormalTextColour", "FF00B9FF") Panel.button[2] = guiCreateButton(154, 311, 114, 29, "اضافة روم", false, Panel.Window[1]) guiSetFont(Panel.button[2], "default-bold-small") guiSetProperty(Panel.button[2], "NormalTextColour", "FF65FF00") Panel.button[3] = guiCreateButton(308, 311, 102, 29, "حذف الروم", false, Panel.Window[1]) guiSetFont(Panel.button[3], "default-bold-small") guiSetProperty(Panel.button[3], "NormalTextColour", "FFFF0000") Panel.Window[2] = guiCreateWindow(523, 122, 354, 390, "==[ اضافة روم جديد # ]==", false) guiSetVisible(Panel.Window[2],false) centerWindow(Panel.Window[2],2,2) guiWindowSetSizable(Panel.Window[2], false) guiSetAlpha(Panel.Window[2], 1.00) guiSetProperty(Panel.Window[2], "CaptionColour", "FF00FFA7") Panel.label[2] = guiCreateLabel(11, 34, 342, 28, "اسم الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[2], "default-bold-small") guiLabelSetColor(Panel.label[2], 255, 0, 0) ServerName = guiCreateEdit(9, 69, 338, 32, "", false, Panel.Window[2]) Panel.label[3] = guiCreateLabel(10, 112, 341, 28, "اي بي الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[3], "default-bold-small") guiLabelSetColor(Panel.label[3], 251, 254, 0) ServerIP = guiCreateEdit(10, 145, 333, 32, "", false, Panel.Window[2]) Panel.label[4] = guiCreateLabel(9, 186, 315, 28, "بورت الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[4], "default-bold-small") guiLabelSetColor(Panel.label[4], 0, 209, 254) ServerPort = guiCreateEdit(10, 224, 331, 32, "", false, Panel.Window[2]) Panel.label[5] = guiCreateLabel(13, 263, 305, 28, "نوع اللعب المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[5], "default-bold-small") guiLabelSetColor(Panel.label[5], 35, 254, 0) ServerType = guiCreateEdit(10, 291, 331, 32, "", false, Panel.Window[2]) Panel.button[4] = guiCreateButton(27, 338, 290, 37, "اضضضافةة الرومم #", false, Panel.Window[2]) guiSetFont(Panel.button[4], "default-bold-small") guiSetProperty(Panel.button[4], "NormalTextColour", "FF00A7FE") addEventHandler("onClientGUIClick",root, function ( ) local row,col = guiGridListGetSelectedItem(Panel.gridlist[1]) local Name = guiGridListGetItemText(Panel.gridlist[1], row, 1) local IP = guiGridListGetItemText(Panel.gridlist[1], row, 2) local Port = guiGridListGetItemText(Panel.gridlist[1], row, 3) if ( source == Panel.button[1] ) then if ( guiGridListGetSelectedItem(Panel.gridlist[1]) == -1 ) then return outputChatBox("* الرجاء اختيار روم للتحويل الية",255,0,0,true) end triggerServerEvent("RedirectPlayer",localPlayer,IP,Port,Name) guiSetVisible(Panel.Window[1],false) showCursor(false) elseif ( source == Panel.button[2] ) then guiSetVisible(Panel.Window[1],false) guiSetVisible(Panel.Window[2],true) showCursor(true) elseif ( source == Panel.button[3] ) then if ( guiGridListGetSelectedItem(Panel.gridlist[1]) == -1 ) then return outputChatBox("* الرجاء اختيار روم لـ حذفة",255,0,0,true) end triggerServerEvent("RemoveServer",localPlayer,Name,IP,Port,row) elseif ( source == Panel.button[4] ) then local name,ip,port,type = guiGetText(ServerName),guiGetText(ServerIP),guiGetText(ServerPort),guiGetText(ServerType) if ( name ~= "" and ip ~= "" and port ~= "" and type ~= "" ) then if not tonumber(port) then return outputChatBox("* خطأ في الاي بي و البورت!!!",255,0,0,true) end triggerServerEvent("Save:To:Data:Base",localPlayer, name, ip, port, type) outputChatBox("* تم اضافة الروم بنجاح",0,255,0,true) guiSetVisible(Panel.Window[2],false) guiSetVisible(Panel.Window[1],true) else outputChatBox("* يجب ملئ جميع الفراغات !!",255,0,0,true) end end end ) addEvent ( "AddTextToGridList", true ) addEventHandler ( "AddTextToGridList", root, function ( ServerName, ServerIP, ServerPort, ServerType ) local row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 4, tostring ( ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 255, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 255, 0, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 0, 255 ) end ) addEvent ( "Add", true ) addEventHandler ( "Add", root, function ( onClientSqlList ) guiGridListClear ( Panel.gridlist[1] ) for _, v in ipairs ( onClientSqlList ) do row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( v.ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( v.ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( v.ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 4, tostring ( v.ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 255, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 255, 0, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 0, 255 ) end end ) addEvent ( "Delete:Grid:Text:" , true) addEventHandler ( "Delete:Grid:Text:" ,root, function ( id ) guiGridListRemoveRow ( Panel.gridlist[1], tonumber( id ) ) end ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "RefreshList", localPlayer ) end ) bindKey (Key, "down", function() if getElementData( localPlayer, 'Show_GUI') ~= nil then guiSetVisible(Panel.Window[1], not guiGetVisible(Panel.Window[1])) showCursor(guiGetVisible(Panel.Window[1])) end end ) addEvent( 'LogOutSetVisible', true ) addEventHandler( 'LogOutSetVisible', root, function() if guiGetVisible(Panel.Window[1]) then guiSetVisible( Panel.Window[1], false ) showCursor( false ) end end ) local function dxSetAlpha ( dx, a ) local r,g,b = dx:color() dx:color(r,g,b,a) end local redict addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() outputChatBox("* سكربت التحكم في الرومات ["..tostring(Key).."] ",0,0,255) redict = dxText:create( "سيتم نقلك الى الروم المطلوب بعد ", 0.5, 0.5, true, "arial", 4 ) redict:type("stroke",1.2) redict:color ( 255,255,0, 0 ) redict:visible(false) end ) local countdownFahad local function countdown(time) for i=time,0,-1 do redict:text(" سيتم نقلك الى الروم "..rName.." | خلال "..i.." ثانية ") setTimer ( countdownFahad, 1000, 1 ) coroutine.yield() if i == 0 then setTimer ( stop, 500, 1 ) end end end function stop() setTimer ( function() redict:visible(false) if tostring( rIP ) and tonumber ( rPort ) then triggerServerEvent("RedictPlayer",localPlayer,rIP,rPort)---Redict Player end end, 600, 1 ) Animation.createAndPlay( redict, {{ from = 255, to = 0, time = 400, fn = dxSetAlpha }} ) end function xShowTime(ip,port,Name) rName = tostring ( Name ) rIP = tostring( ip ) rPort = tonumber( port ) Animation.createAndPlay( redict, {{ from = 0, to = 255, time = 600, fn = dxSetAlpha }} ) redict:visible(true) countdownFahad = coroutine.wrap(countdown) countdownFahad(time) end addEvent("xShowTime",true) addEventHandler("xShowTime",root,xShowTime) ---------------------- -- This Script -- Scripted By -- Mr.Pres[T]ege -- Mail : [email protected] -- Main : [email protected] -- Skype : Mr.PresTege -- [url=http://www.gta-arabs.com]www.gta-arabs.com[/url] ---------------------- local allowedGroup = "Console" --------------------- -- SQL DataBase -------------------- addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS SQL_Data (ServerName,ServerIP,ServerPort,ServerType)" ) outputDebugString("SQL Data Base Server Owner System Started!",0,0,255,0,0) for i, player in ipairs( getElementsByType( 'player' ) ) do if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then setElementData( player, 'Show_GUI', true) else setElementData( player, 'Show_GUI', nil) end end end ) function setSQL_Data ( ServerName, ServerIP, ServerPort, ServerType ) return executeSQLQuery ( "INSERT INTO `SQL_Data` ( `ServerName`, `ServerIP`, `ServerPort`, `ServerType` ) VALUES ( ?, ?, ?, ? )", tostring(ServerName), tostring(ServerIP), tostring(ServerPort), tostring(ServerType) ) end function SelectFromSql ( ) local data = executeSQLQuery ( "SELECT * FROM SQL_Data" ) if ( type ( data ) == "table" and #data == 0) or not data then return { } else return data end end function UpDateListInSql ( element ) if ( not isElement ( element ) ) then return end local Upsql = SelectFromSql ( ) triggerClientEvent ( element, "Add", element, Upsql ) end addEvent ( "RefreshList", true ) addEventHandler ( "RefreshList", root, function ( ) UpDateListInSql ( source ) end ) addEvent ( "Save:To:Data:Base", true ) addEventHandler ( "Save:To:Data:Base", root, function ( ServerName, ServerIP, ServerPort, ServerType ) setSQL_Data ( ServerName, ServerIP, ServerPort, ServerType ) triggerClientEvent ( root, "AddTextToGridList", root, ServerName, ServerIP, ServerPort, ServerType ) end ) addEvent("RemoveServer", true) addEventHandler("RemoveServer", root, function(Name,IP,Port,row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `ServerName` = '" .. tostring(Name) .. "' AND ServerIP = '" .. tostring(IP) .. "' AND ServerPort = '" .. tostring(Port) .. "'") then triggerClientEvent("Delete:Grid:Text:",root,tonumber(row)) end end ) addEventHandler( 'onPlayerJoin', root, function() setElementData( source, 'Show_GUI', nil) end ) addEventHandler( 'onPlayerLogin', root, function( _, acc ) if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( allowedGroup ) ) then setElementData( source, 'Show_GUI', true) else setElementData( source, 'Show_GUI', nil) end end ) addEventHandler( 'onPlayerLogout', root, function( _, acc ) triggerClientEvent( source, 'LogOutSetVisible', root) setElementData( source, 'Show_GUI', nil) end ) -------------------- -- Main Function -------------------- addEvent("RedirectPlayer",true) addEventHandler("RedirectPlayer",root, function ( IP,Port,Name ) for SQL,v in ipairs(getElementsByType("player")) do triggerClientEvent( v, 'xShowTime', v, tostring(IP),tonumber(Port),tostring(Name)) end end ) addEvent("RedictPlayer",true) addEventHandler("RedictPlayer",root, function ( IP,Port ) redirectPlayer (source,tostring(IP),tonumber(Port)) end ) بالتوفــيـــق .. Link to comment
Mr-M3AND Posted January 6, 2014 Author Share Posted January 6, 2014 addEventHandler("onClientGUIClick",GUIEditor_Button[2], function () local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if guiGridListGetSelectedItem( GUIEditor_Grid[1]) == -1 then return end triggerServerEvent("RemoveRow",localPlayer,carName,row) end ) من بداية سطر 14 لو تلاحظ : triggerServerEvent("RemoveRow",localPlayer,carName,row) carName = غير معــــرفــــــه .. هذا سكربت سويتة قبل سنة تقريباً تقدر تستفيد منة نفس طريقتك بس ركز يبي لة فهم زين وش العمود اللي تبي تحذفة وين اللي مختارة ادرسة زين ذذ : ---------------------- -- This Script -- Scripted By -- Mr.Pres[T]ege -- Mail : [email protected] -- Main : [email protected] -- Skype : Mr.PresTege -- [url=http://www.gta-arabs.com]http://www.gta-arabs.com[/url] ---------------------- local Key = "F10" Panel = { gridlist = {}, button = {}, label = {}, edit = {}, Window = {}, } local rIP local rPort local rName time = 15 --- time count - default : 10 seconds function centerWindow(center_window,i,v) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/i,(screenH-windowH)/v guiSetPosition(center_window,x,y,false) end Panel.Window[1] = guiCreateWindow(37, 109, 420, 358, "==[ التحكم في التحويل بين الرومات ]==", false) centerWindow(Panel.Window[1],2,2) guiSetVisible(Panel.Window[1],false) guiWindowSetSizable(Panel.Window[1], false) guiSetAlpha(Panel.Window[1], 1.00) guiSetProperty(Panel.Window[1], "CaptionColour", "FFEFFF00") Panel.gridlist[1] = guiCreateGridList(9, 21, 402, 278, false, Panel.Window[1]) guiGridListAddColumn(Panel.gridlist[1], "اسم الروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "آي بي الروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "البورت للروم #", 0.2) guiGridListAddColumn(Panel.gridlist[1], "نوع اللعب #", 0.2) Panel.button[1] = guiCreateButton(11, 311, 114, 29, "التحويل للروم", false, Panel.Window[1]) guiSetFont(Panel.button[1], "default-bold-small") guiSetProperty(Panel.button[1], "NormalTextColour", "FF00B9FF") Panel.button[2] = guiCreateButton(154, 311, 114, 29, "اضافة روم", false, Panel.Window[1]) guiSetFont(Panel.button[2], "default-bold-small") guiSetProperty(Panel.button[2], "NormalTextColour", "FF65FF00") Panel.button[3] = guiCreateButton(308, 311, 102, 29, "حذف الروم", false, Panel.Window[1]) guiSetFont(Panel.button[3], "default-bold-small") guiSetProperty(Panel.button[3], "NormalTextColour", "FFFF0000") Panel.Window[2] = guiCreateWindow(523, 122, 354, 390, "==[ اضافة روم جديد # ]==", false) guiSetVisible(Panel.Window[2],false) centerWindow(Panel.Window[2],2,2) guiWindowSetSizable(Panel.Window[2], false) guiSetAlpha(Panel.Window[2], 1.00) guiSetProperty(Panel.Window[2], "CaptionColour", "FF00FFA7") Panel.label[2] = guiCreateLabel(11, 34, 342, 28, "اسم الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[2], "default-bold-small") guiLabelSetColor(Panel.label[2], 255, 0, 0) ServerName = guiCreateEdit(9, 69, 338, 32, "", false, Panel.Window[2]) Panel.label[3] = guiCreateLabel(10, 112, 341, 28, "اي بي الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[3], "default-bold-small") guiLabelSetColor(Panel.label[3], 251, 254, 0) ServerIP = guiCreateEdit(10, 145, 333, 32, "", false, Panel.Window[2]) Panel.label[4] = guiCreateLabel(9, 186, 315, 28, "بورت الروم المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[4], "default-bold-small") guiLabelSetColor(Panel.label[4], 0, 209, 254) ServerPort = guiCreateEdit(10, 224, 331, 32, "", false, Panel.Window[2]) Panel.label[5] = guiCreateLabel(13, 263, 305, 28, "نوع اللعب المراد اضافتة للستة #", false, Panel.Window[2]) guiSetFont(Panel.label[5], "default-bold-small") guiLabelSetColor(Panel.label[5], 35, 254, 0) ServerType = guiCreateEdit(10, 291, 331, 32, "", false, Panel.Window[2]) Panel.button[4] = guiCreateButton(27, 338, 290, 37, "اضضضافةة الرومم #", false, Panel.Window[2]) guiSetFont(Panel.button[4], "default-bold-small") guiSetProperty(Panel.button[4], "NormalTextColour", "FF00A7FE") addEventHandler("onClientGUIClick",root, function ( ) local row,col = guiGridListGetSelectedItem(Panel.gridlist[1]) local Name = guiGridListGetItemText(Panel.gridlist[1], row, 1) local IP = guiGridListGetItemText(Panel.gridlist[1], row, 2) local Port = guiGridListGetItemText(Panel.gridlist[1], row, 3) if ( source == Panel.button[1] ) then if ( guiGridListGetSelectedItem(Panel.gridlist[1]) == -1 ) then return outputChatBox("* الرجاء اختيار روم للتحويل الية",255,0,0,true) end triggerServerEvent("RedirectPlayer",localPlayer,IP,Port,Name) guiSetVisible(Panel.Window[1],false) showCursor(false) elseif ( source == Panel.button[2] ) then guiSetVisible(Panel.Window[1],false) guiSetVisible(Panel.Window[2],true) showCursor(true) elseif ( source == Panel.button[3] ) then if ( guiGridListGetSelectedItem(Panel.gridlist[1]) == -1 ) then return outputChatBox("* الرجاء اختيار روم لـ حذفة",255,0,0,true) end triggerServerEvent("RemoveServer",localPlayer,Name,IP,Port,row) elseif ( source == Panel.button[4] ) then local name,ip,port,type = guiGetText(ServerName),guiGetText(ServerIP),guiGetText(ServerPort),guiGetText(ServerType) if ( name ~= "" and ip ~= "" and port ~= "" and type ~= "" ) then if not tonumber(port) then return outputChatBox("* خطأ في الاي بي و البورت!!!",255,0,0,true) end triggerServerEvent("Save:To:Data:Base",localPlayer, name, ip, port, type) outputChatBox("* تم اضافة الروم بنجاح",0,255,0,true) guiSetVisible(Panel.Window[2],false) guiSetVisible(Panel.Window[1],true) else outputChatBox("* يجب ملئ جميع الفراغات !!",255,0,0,true) end end end ) addEvent ( "AddTextToGridList", true ) addEventHandler ( "AddTextToGridList", root, function ( ServerName, ServerIP, ServerPort, ServerType ) local row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 4, tostring ( ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 255, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 255, 0, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 0, 255 ) end ) addEvent ( "Add", true ) addEventHandler ( "Add", root, function ( onClientSqlList ) guiGridListClear ( Panel.gridlist[1] ) for _, v in ipairs ( onClientSqlList ) do row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( v.ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( v.ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( v.ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 4, tostring ( v.ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 255, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 255, 0, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 0 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 0, 255 ) end end ) addEvent ( "Delete:Grid:Text:" , true) addEventHandler ( "Delete:Grid:Text:" ,root, function ( id ) guiGridListRemoveRow ( Panel.gridlist[1], tonumber( id ) ) end ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "RefreshList", localPlayer ) end ) bindKey (Key, "down", function() if getElementData( localPlayer, 'Show_GUI') ~= nil then guiSetVisible(Panel.Window[1], not guiGetVisible(Panel.Window[1])) showCursor(guiGetVisible(Panel.Window[1])) end end ) addEvent( 'LogOutSetVisible', true ) addEventHandler( 'LogOutSetVisible', root, function() if guiGetVisible(Panel.Window[1]) then guiSetVisible( Panel.Window[1], false ) showCursor( false ) end end ) local function dxSetAlpha ( dx, a ) local r,g,b = dx:color() dx:color(r,g,b,a) end local redict addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() outputChatBox("* سكربت التحكم في الرومات ["..tostring(Key).."] ",0,0,255) redict = dxText:create( "سيتم نقلك الى الروم المطلوب بعد ", 0.5, 0.5, true, "arial", 4 ) redict:type("stroke",1.2) redict:color ( 255,255,0, 0 ) redict:visible(false) end ) local countdownFahad local function countdown(time) for i=time,0,-1 do redict:text(" سيتم نقلك الى الروم "..rName.." | خلال "..i.." ثانية ") setTimer ( countdownFahad, 1000, 1 ) coroutine.yield() if i == 0 then setTimer ( stop, 500, 1 ) end end end function stop() setTimer ( function() redict:visible(false) if tostring( rIP ) and tonumber ( rPort ) then triggerServerEvent("RedictPlayer",localPlayer,rIP,rPort)---Redict Player end end, 600, 1 ) Animation.createAndPlay( redict, {{ from = 255, to = 0, time = 400, fn = dxSetAlpha }} ) end function xShowTime(ip,port,Name) rName = tostring ( Name ) rIP = tostring( ip ) rPort = tonumber( port ) Animation.createAndPlay( redict, {{ from = 0, to = 255, time = 600, fn = dxSetAlpha }} ) redict:visible(true) countdownFahad = coroutine.wrap(countdown) countdownFahad(time) end addEvent("xShowTime",true) addEventHandler("xShowTime",root,xShowTime) ---------------------- -- This Script -- Scripted By -- Mr.Pres[T]ege -- Mail : [email protected] -- Main : [email protected] -- Skype : Mr.PresTege -- [url=http://www.gta-arabs.com]http://www.gta-arabs.com[/url] ---------------------- local allowedGroup = "Console" --------------------- -- SQL DataBase -------------------- addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS SQL_Data (ServerName,ServerIP,ServerPort,ServerType)" ) outputDebugString("SQL Data Base Server Owner System Started!",0,0,255,0,0) for i, player in ipairs( getElementsByType( 'player' ) ) do if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then setElementData( player, 'Show_GUI', true) else setElementData( player, 'Show_GUI', nil) end end end ) function setSQL_Data ( ServerName, ServerIP, ServerPort, ServerType ) return executeSQLQuery ( "INSERT INTO `SQL_Data` ( `ServerName`, `ServerIP`, `ServerPort`, `ServerType` ) VALUES ( ?, ?, ?, ? )", tostring(ServerName), tostring(ServerIP), tostring(ServerPort), tostring(ServerType) ) end function SelectFromSql ( ) local data = executeSQLQuery ( "SELECT * FROM SQL_Data" ) if ( type ( data ) == "table" and #data == 0) or not data then return { } else return data end end function UpDateListInSql ( element ) if ( not isElement ( element ) ) then return end local Upsql = SelectFromSql ( ) triggerClientEvent ( element, "Add", element, Upsql ) end addEvent ( "RefreshList", true ) addEventHandler ( "RefreshList", root, function ( ) UpDateListInSql ( source ) end ) addEvent ( "Save:To:Data:Base", true ) addEventHandler ( "Save:To:Data:Base", root, function ( ServerName, ServerIP, ServerPort, ServerType ) setSQL_Data ( ServerName, ServerIP, ServerPort, ServerType ) triggerClientEvent ( root, "AddTextToGridList", root, ServerName, ServerIP, ServerPort, ServerType ) end ) addEvent("RemoveServer", true) addEventHandler("RemoveServer", root, function(Name,IP,Port,row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `ServerName` = '" .. tostring(Name) .. "' AND ServerIP = '" .. tostring(IP) .. "' AND ServerPort = '" .. tostring(Port) .. "'") then triggerClientEvent("Delete:Grid:Text:",root,tonumber(row)) end end ) addEventHandler( 'onPlayerJoin', root, function() setElementData( source, 'Show_GUI', nil) end ) addEventHandler( 'onPlayerLogin', root, function( _, acc ) if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( allowedGroup ) ) then setElementData( source, 'Show_GUI', true) else setElementData( source, 'Show_GUI', nil) end end ) addEventHandler( 'onPlayerLogout', root, function( _, acc ) triggerClientEvent( source, 'LogOutSetVisible', root) setElementData( source, 'Show_GUI', nil) end ) -------------------- -- Main Function -------------------- addEvent("RedirectPlayer",true) addEventHandler("RedirectPlayer",root, function ( IP,Port,Name ) for SQL,v in ipairs(getElementsByType("player")) do triggerClientEvent( v, 'xShowTime', v, tostring(IP),tonumber(Port),tostring(Name)) end end ) addEvent("RedictPlayer",true) addEventHandler("RedictPlayer",root, function ( IP,Port ) redirectPlayer (source,tostring(IP),tonumber(Port)) end ) بالتوفــيـــق .. الله يعطيك العافية يابرستيج ان شاءالله الكود ينفعني بشوف وش يصير معي ورد خبر Link to comment
Mr-M3AND Posted January 6, 2014 Author Share Posted January 6, 2014 بس نفس المشكلة ينحذف بس لما اسوي ريستارت يرجعون مثل اول carName للاسف ماضبط عرفت الكلمه هذي :: Client addEventHandler("onClientGUIClick",GUIEditor_Button[2], function () local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if guiGridListGetSelectedItem( GUIEditor_Grid[1]) == -1 then return end triggerServerEvent("RemoveRow",localPlayer,carName,row) end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow" ,root, function ( carName ) guiGridListRemoveRow (GUIEditor_Grid[1], tostring( carName ) ) end ) :: Server addEvent("RemoveRow", true) addEventHandler("RemoveRow", root, function(carName,row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `carName` = ? ", tostring(carName) ) then triggerClientEvent("DeleteRow",root, tostring( row)) end end ) Link to comment
#DRAGON!FIRE Posted January 6, 2014 Share Posted January 6, 2014 Client Side ! addEventHandler( "onClientGUIClick", GUIEditor_Button[2], function ( ) local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("RemoveRow", localPlayer, carName, row) end end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow", root, function ( carName ) if ( carName and carName ~= nil ) then guiGridListRemoveRow ( GUIEditor_Grid[1], carName ) end end ) Server Side ! addEvent("RemoveRow", true) addEventHandler("RemoveRow", root, function(carName, row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `carName` = ? ", tostring(carName) ) then triggerClientEvent(root, "DeleteRow", root, tostring( row )) end end ) + . وتأكد كل شي صحيح carName تأكد انك مسوي قاعدة البيانات , وفي رو بـ ذا الاسم Link to comment
iPrestege Posted January 6, 2014 Share Posted January 6, 2014 ابي افهم carName هذي وين معرفينها فيه ؟؟؟؟؟؟؟؟؟ وكيف تبونــة يـحذفــة و هــو غــيــــــــــــــــــر معــــــــــــــــرف Link to comment
Mr-M3AND Posted January 7, 2014 Author Share Posted January 7, 2014 Client Side ! addEventHandler( "onClientGUIClick", GUIEditor_Button[2], function ( ) local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("RemoveRow", localPlayer, carName, row) end end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow", root, function ( carName ) if ( carName and carName ~= nil ) then guiGridListRemoveRow ( GUIEditor_Grid[1], carName ) end end ) Server Side ! addEvent("RemoveRow", true) addEventHandler("RemoveRow", root, function(carName, row) if executeSQLQuery("DELETE FROM `SQL_Data` WHERE `carName` = ? ", tostring(carName) ) then triggerClientEvent(root, "DeleteRow", root, tostring( row )) end end ) + . وتأكد كل شي صحيح carName تأكد انك مسوي قاعدة البيانات , وفي رو بـ ذا الاسم للاسف نفس الشي ابي افهم carNameهذي وين معرفينها فيه ؟؟؟؟؟؟؟؟؟ وكيف تبونــة يـحذفــة و هــو غــيــــــــــــــــــر معــــــــــــــــرف طيب كيف اعرفها..؟؟ Link to comment
#DRAGON!FIRE Posted January 7, 2014 Share Posted January 7, 2014 carName انا صصحت بعض الاخطاء اللي عندك , وقلت لك عرف ? carName انت وش تقصد بـ Link to comment
Mr-M3AND Posted January 7, 2014 Author Share Posted January 7, 2014 carName انا صصحت بعض الاخطاء اللي عندك , وقلت لك عرف? carName انت وش تقصد بـ هذا carName اقصد local carID = guiGetText(GUIEditor_Edit[5]) local carName = getVehicleNameFromModel ( tonumber ( carID ) ) Link to comment
#DRAGON!FIRE Posted January 7, 2014 Share Posted January 7, 2014 Client Side ! addEventHandler( "onClientGUIClick", GUIEditor_Button[2], function ( ) local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if ( row and col and row ~= -1 and col ~= -1 ) then local carID = guiGetText(GUIEditor_Edit[5] ) local carName = getVehicleNameFromModel ( tonumber ( carID ) ) triggerServerEvent("RemoveRow", localPlayer, carName, row) end end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow", root, function ( carName ) if ( carName and carName ~= nil ) then guiGridListRemoveRow ( GUIEditor_Grid[1], carName ) end end ) Link to comment
Mr-M3AND Posted January 7, 2014 Author Share Posted January 7, 2014 Client Side ! addEventHandler( "onClientGUIClick", GUIEditor_Button[2], function ( ) local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if ( row and col and row ~= -1 and col ~= -1 ) then local carID = guiGetText(GUIEditor_Edit[5] ) local carName = getVehicleNameFromModel ( tonumber ( carID ) ) triggerServerEvent("RemoveRow", localPlayer, carName, row) end end ) addEvent ( "DeleteRow" , true) addEventHandler ( "DeleteRow", root, function ( carName ) if ( carName and carName ~= nil ) then guiGridListRemoveRow ( GUIEditor_Grid[1], carName ) end end ) برضو ماتغير شي Link to comment
فاّرس Posted January 7, 2014 Share Posted January 7, 2014 وش تبي تسوي بالضبط؟, الي فهمته انك تبي لو حذفت سيارته تختفي من الجريد ليست صح ولا لا؟ طيب كيف نظام الجريد ليست؟ يعني اسم اللاعب وجنبه رو مكتوب فيه انه معه سياره؟ واطرح اكوادك كامله ,, Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now