Adham Posted May 17, 2016 Share Posted May 17, 2016 سلام عليكم اتا قريد لست فيه اسم السياره واي دي ظاهر عادي انا عاوز لما يحدد شي بالقريد لست يجي السياره الكود العملتو بس ما ظبت for i , v in ipairs ( TableList ) do Row = guiGridListAddRow ( gridlist ) guiGridListSetItemText( gridlist,Row ,1,v[1],false,false); guiGridListSetItemText( gridlist,Row ,2,v[2],false,false); guiGridListSetItemData ( gridlist , Row , 1 , v[3] ) end addEventHandler("onClientGUIClick",resourceRoot, function ( ) if source == CreatedCar then local Se = guiGridListGetSelectedItem( gridlist ) if Se and Se ~= -1 then local iD = guiGridListGetItemData ( gridlist , Se , 1 ) triggerServerEvent ( "GiveVehicle",localPlayer , ID ) end end end ) ; سرفر local table = { } addEvent("GiveVehicle" ,true) addEventHandler("GiveVehicle" ,root, function ( id ) if isElement( table[ source ] ) then destroyElement ( table[ source] ) end PosX , PosY , PosZ = getElementPosition ( source ) takePlayerMoney( source , tonumber ( Money ) ) table[ source ] = createVehicle( id , PosX , PosY , PosZ ) outputChatBox("* تم شراء الشخصيه",source ,0,255,0,false) end end ) ; Link to comment
SPLM Posted May 17, 2016 Share Posted May 17, 2016 takePlayerMoney( source , tonumber ( Money ) ) ^ Money غير معرفه Link to comment
Mr.CoR Posted May 17, 2016 Share Posted May 17, 2016 اطرح الجدول الي مستخدمه انت بالسكربت الي اسمه TableList Link to comment
Adham Posted May 17, 2016 Author Share Posted May 17, 2016 TableList = { {"Alpha", 602}, {"Banshee", 429}, {"Buffalo", 402}, {"Bullet", 541}, {"Flatbed", 455}, {"Forklift", 530}, {"Linerunner", 403}, {"Packer", 443}, {"Roadtrain", 515}, {"Sweeper", 574}, {"Tanker", 514}, {"Towtruck", 525}, {"Trashmaster", 408}, {"Utility van", 552}, {"Benson", 499}, {"Black Boxville", 609}, {"Bobcat", 422}, {"Boxville", 498}, {"Maverick", 487}, {"News Chopper", 488}, {"Police Maverick", 497}, {"Raindance", 563}, {"Sparrow", 469}, {"Beagle", 511}, {"Cropduster", 512}, {"Dodo", 593}, {"Nevada", 553}, {"Rustler", 476}, {"Shamal", 519}, {"Skimmer", 460}, {"Stuntplane", 513} } Link to comment
Ahmed Ly Posted May 17, 2016 Share Posted May 17, 2016 TableList = { {"Alpha", 602}, {"Banshee", 429}, {"Buffalo", 402}, {"Bullet", 541}, {"Flatbed", 455}, {"Forklift", 530}, {"Linerunner", 403}, {"Packer", 443}, {"Roadtrain", 515}, {"Sweeper", 574}, {"Tanker", 514}, {"Towtruck", 525}, {"Trashmaster", 408}, {"Utility van", 552}, {"Benson", 499}, {"Black Boxville", 609}, {"Bobcat", 422}, {"Boxville", 498}, {"Maverick", 487}, {"News Chopper", 488}, {"Police Maverick", 497}, {"Raindance", 563}, {"Sparrow", 469}, {"Beagle", 511}, {"Cropduster", 512}, {"Dodo", 593}, {"Nevada", 553}, {"Rustler", 476}, {"Shamal", 519}, {"Skimmer", 460}, {"Stuntplane", 513} } for i , v in ipairs ( TableList ) do Row = guiGridListAddRow ( gridlist ) guiGridListSetItemText( gridlist,Row ,1,v[1],false,false); guiGridListSetItemText( gridlist,Row ,2,v[2],false,false); guiGridListSetItemData ( gridlist , Row , 2 , v[2] ,false,false) end addEventHandler("onClientGUIClick",resourceRoot, function ( ) if source == CreatedCar then local Se = guiGridListGetSelectedItem( gridlist ) local ID = guiGridListGetItemData ( gridlist , Se , 2 ) triggerServerEvent ( "GiveVehicle",localPlayer , ID ) end end ) ; ----------------------------------- local table = { } addEvent("GiveVehicle" ,true) addEventHandler("GiveVehicle" ,root, function ( ID ) if isElement( table[ source ] ) then destroyElement ( table[ source] ) end PosX , PosY , PosZ = getElementPosition ( source ) table[ source ] = createVehicle( ID , PosX , PosY , PosZ ) outputChatBox("* تم شراء سياره",source ,0,255,0,false) end ) Link to comment
Ahmed Ly Posted May 17, 2016 Share Posted May 17, 2016 (edited) ما تنزل مركبة انت تبي لاعب يركب في سياره طول ولا كيف Edited May 17, 2016 by Guest Link to comment
Adham Posted May 17, 2016 Author Share Posted May 17, 2016 انا عامل رنت سيستم وضايف قريد لست قدول فيه اول شي اسم العربيه والتاني اي دي السياره بعدين عاوز اليحدد شي عليه ويضعط علي ال button ينزل سياره علي حسب الاي دي Link to comment
Ahmed Ly Posted May 17, 2016 Share Posted May 17, 2016 -----#Server local table = { } addEvent("GiveVehicle" ,true) addEventHandler("GiveVehicle" ,root, function ( ID ) if isElement( table[ source ] ) then destroyElement ( table[ source] ) end local PosX , PosY , PosZ = getElementPosition ( source ) table[ source ] = createVehicle( ID , PosX , PosY , PosZ ) warpPlayerIntoVehicle(source,table[ source ]) outputChatBox("* تم شراء سياره",source ,0,255,0,false) end ) ------------------Client GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[1] = guiCreateWindow(241, 183, 608, 393, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(28, 49, 548, 247, false, GUIEditor.window[1]) cow1 = guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.5) cow2 = guiGridListAddColumn(GUIEditor.gridlist[1], "ID", 0.5) GUIEditor.button[1] = guiCreateButton(27, 311, 182, 59, "Buy", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") guiSetVisible ( GUIEditor.window[1], false) function OpenWin() if guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( GUIEditor.window[1], true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F2", "down", OpenWin) TableList = { {"Alpha", 602}, {"Banshee", 429}, {"Buffalo", 402}, {"Bullet", 541}, {"Flatbed", 455}, {"Forklift", 530}, {"Linerunner", 403}, {"Packer", 443}, {"Roadtrain", 515}, {"Sweeper", 574}, {"Tanker", 514}, {"Towtruck", 525}, {"Trashmaster", 408}, {"Utility van", 552}, {"Benson", 499}, {"Black Boxville", 609}, {"Bobcat", 422}, {"Boxville", 498}, {"Maverick", 487}, {"News Chopper", 488}, {"Police Maverick", 497}, {"Raindance", 563}, {"Sparrow", 469}, {"Beagle", 511}, {"Cropduster", 512}, {"Dodo", 593}, {"Nevada", 553}, {"Rustler", 476}, {"Shamal", 519}, {"Skimmer", 460}, {"Stuntplane", 513} } for i , v in ipairs ( TableList ) do Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText( GUIEditor.gridlist[1],Row ,cow1,v[1],false,false); guiGridListSetItemText( GUIEditor.gridlist[1],Row ,cow2,v[2],false,false); guiGridListSetItemData ( GUIEditor.gridlist[1] , Row , cow2 , v[2] ,false,false) end addEventHandler("onClientGUIClick",resourceRoot, function ( ) if source == GUIEditor.button[1] then local Se = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) local ID = guiGridListGetItemData ( GUIEditor.gridlist[1] , Se , cow2 ) triggerServerEvent ( "GiveVehicle",localPlayer , ID ) end end ) ; Link to comment
Mr.CoR Posted May 18, 2016 Share Posted May 18, 2016 بالنسبة للعبة هذا طلبك الي طلبته مني بالوتساب -- Client -- 6LAB LE3BA -- -- By Mr.CoR -- -- 18/5/2016 -- local Vehicles = { {'Alpha',602}, {'Banshee',429}, {'Buffalo',402}, {'Bullet',541}, {'Cheetah',415}, {'Comet',480}, {'Elegy',562}, {'Euros',587}, {'Flash',565}, {'Infernus',411} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 467) / 2, (screenH - 294) / 2, 467, 294, ":: [ 6LAB LE3BA ] ::", false) guiWindowSetSizable(window, false) guiSetAlpha(window, 0.98) GridList = guiCreateGridList(9, 23, 217, 261, false, window) guiGridListAddColumn(GridList, "#", 0.3) guiGridListAddColumn(GridList, "Car Name", 0.5) guiGridListAddColumn(GridList, "", 0.1) CreateButton = guiCreateButton(258, 132, 176, 43, "==]> Create Vehivle <[==", false, window) guiSetProperty(CreateButton, "NormalTextColour", "FFFFFEFE") check = guiCreateCheckBox(264, 185, 15, 15, "", false, false, window) NoneLeble = guiCreateLabel(289, 185, 114, 15, "Auto Enter To The Vehicle", false, window) guiSetFont(NoneLeble, "default-small") -- Vehicles loop for k,v in ipairs ( Vehicles ) do local row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, row, 1, "".. k ..".", false, false ) -- هذا يحط الارقام guiGridListSetItemText ( GridList , row , 2 , v[1] , false , false ) -- هذا يحط اسم السيارة guiGridListSetItemData ( GridList , row , 1 , v[2] ) -- هذا يحط داتا على اي دي السيارة end end ) addEventHandler("onClientGUIClick", root, function () if ( source == CreateButton ) then if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then triggerServerEvent('CreateVehicle',getLocalPlayer(),guiGridListGetItemData ( GridList , guiGridListGetSelectedItem ( GridList ) , 1 ) ) if(guiCheckBoxGetSelected(check))then if guiCheckBoxSetSelected(check,false) then end if guiCheckBoxSetSelected(check,true) then triggerServerEvent('EnterVehicle',getLocalPlayer() ) end end end end end ) Server local Vehicle = { } addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root, function ( id ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local Position = { getElementPosition ( source ) } Vehicle[source] = createVehicle ( id , Position[1] + 1, Position[2] + 1 , Position[3] ) end ) addEventHandler('onPlayerQuit',root, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end end) addEvent('EnterVehicle',true) addEventHandler('EnterVehicle',root, function () warpPedIntoVehicle ( source , Vehicle[source] ) end ) 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