#Soking Posted May 27, 2016 Share Posted May 27, 2016 سسويتت بعض الاشياء جرب المود والاكواد التبيها خدها منه ماكملته يعني ماحطيت زر تصليح و ماسويت SQL للجريد ليست تفضل جرب + في اف11 بتحصل علامه Client = VehiclesID = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 592, 553, 577, 488, 511, 497, 548, 563, 512, 476, 593, 447, 425, 519, 520, 460, 417, 469, 487, 513, 581, 510, 509, 522, 481, 461, 462, 448, 521, 468, 463, 586, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 523, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 449, 537, 538, 441, 464, 501, 465, 564, 568, 557, 424, 471, 504, 495, 457, 539, 483, 508, 571, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 606, 607, 610, 590, 569, 611, 584, 608, 435, 450, 591, 594 } PositionMarker = { { 2088.12, 1517, 10.82 }, } function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) local text = guiGridListGetItemText ( gridList, item, column or 1 ) if ( text ~= '' ) then return text else return false end end function SetPanelVisible( Panel , Stats ) guiSetVisible(Panel,Stats) showCursor(Stats) end for _, MarkerCreate in pairs( PositionMarker ) do local xPos, yPos, zPos = MarkerCreate[1], MarkerCreate[2], MarkerCreate[3] Marker = createMarker(xPos, yPos, zPos-2,'cylinder',2,255,255,255) addEventHandler('onClientMarkerHit',root, function ( hPlayer ) if ( source == Marker ) and ( hPlayer == localPlayer ) and ( not isPedInVehicle(hPlayer) ) then SetPanelVisible( GUIEditor.window[1] , true ) end end ) addEventHandler('onClientMarkerLeave',root,function ( hPlayer ) if ( source == Marker ) and ( hPlayer == localPlayer) then SetPanelVisible( GUIEditor.window[1] , false ) end end ) end setBlipVisibleDistance( createBlipAttachedTo(Marker,55) , 1000 ) GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[1] = guiCreateWindow(246, 166, 285, 370, "Vehicle Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) VehShopGrid = guiCreateGridList(9, 21, 265, 150, false, GUIEditor.window[1]) local colm = guiGridListAddColumn(VehShopGrid, "Vehicles", 0.9) guiGridListClear (VehShopGrid) for _, v in pairs( VehiclesID ) do if getVehicleNameFromModel(v) ~= "" or nil then guiGridListSetItemText (VehShopGrid,guiGridListAddRow (VehShopGrid),colm,getVehicleNameFromModel(v), false, false ) end end YourB = guiCreateButton(9, 175, 134, 30, "Buy", false, GUIEditor.window[1]) YourGrideList = guiCreateGridList(9, 211, 265, 149, false, GUIEditor.window[1]) guiGridListAddColumn(YourGrideList, "Vehicles Me", 0.9) GUIEditor.button[2] = guiCreateButton(156, 175, 119, 30, "Close", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick",GUIEditor.button[2],function ( ) SetPanelVisible( GUIEditor.window[1] , false ) end , false ) addEventHandler("onClientGUIClick",YourB, function ( ) if ( getElementData(localPlayer,'VehicleMe') or 0 ) < 10 then if ( guiGridListGetSelectedItem(VehShopGrid ) ~= -1 ) then local Row, TextGride, xPos, yPos, zPos = guiGridListAddRow ( YourGrideList ) , guiGridListGetSelectedItemText(VehShopGrid ,colm ) ,getElementPosition(localPlayer) guiGridListSetItemText ( YourGrideList, Row, colm, TextGride, false, false ) local Vehicle = getVehicleIDFromName(TextGride) triggerServerEvent('CreateTheCar',localPlayer,Vehicle,xPos,yPos,zPos) guiGridListRemoveRow(VehShopGrid,guiGridListGetSelectedItem(VehShopGrid)) SetPanelVisible( GUIEditor.window[1] , false ) outputChatBox(getVehicleNameFromID(Vehicle) ) else outputChatBox("Error ",255,0,0) end else outputChatBox('لا يمكنك شراء اكثر من 10 سيارات',255,255,255) end end , false ) -- لتصفير الداتا لشراء سيارات كثيره addCommandHandler('Remove',function ( ) setElementData(localPlayer,'VehicleMe',0) end ) Server = Vehicles = { } addEvent('CreateTheCar',true) addEventHandler('CreateTheCar',root, function( Vehicle, xPos,yPos,zPos ) if ( getElementInterior(source) == 0 ) and ( getElementDimension(source) == 0 ) then Vehicles[source] = createVehicle(Vehicle ,xPos, yPos+1, zPos+1) warpPedIntoVehicle(source,Vehicles[source]) setElementData(Vehicles[source], "Owner", true ) setElementData(source,'VehicleMe',(getElementData(source,'VehicleMe') or 0 ) + 1 ) end end ) Link to comment
Maksoud Posted May 28, 2016 Author Share Posted May 28, 2016 شكرا على تعبك بس فيه اخطاء اولا انا ما كنت ابيه يشيل الرو من لوحة المعرض الكنت ابيه كله انه ينسخ الرو من اللوحة ذي للوحة ذي يعنى مثلا اشتريت BMW E46 افتح اف 3 الاقى BMW E46 بس انا افتح اف 3 الاقى رقم 4 او 0 او 5 او 2 بدى يظهر بدل الارقام اسماء السيارات Link to comment
#Soking Posted May 28, 2016 Share Posted May 28, 2016 هوا بالفعل يظهر اسماء السيارات وهو يشيل الرو من المعرض لك بس لانك اشتريت سياره نقل الرو ولا انت بدك تشتري مليون سياره نفس النوع ض1 Link to comment
Maksoud Posted June 3, 2016 Author Share Posted June 3, 2016 فى خطأ الدى بق يقول : ERROR: Vehicle-System\VehCWnd.lua:159: attempt to call global 'guiGridListGetSelectedItemText' (a nil value) Link to comment
iMr.WiFi..! Posted June 3, 2016 Share Posted June 3, 2016 VehiclesID = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 592, 553, 577, 488, 511, 497, 548, 563, 512, 476, 593, 447, 425, 519, 520, 460, 417, 469, 487, 513, 581, 510, 509, 522, 481, 461, 462, 448, 521, 468, 463, 586, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 523, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 449, 537, 538, 441, 464, 501, 465, 564, 568, 557, 424, 471, 504, 495, 457, 539, 483, 508, 571, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 606, 607, 610, 590, 569, 611, 584, 608, 435, 450, 591, 594 } PositionMarker = { { 2088.12, 1517, 10.82 }, } function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) local text = guiGridListGetItemText ( gridList, item, column or 1 ) if ( text ~= '' ) then return text else return false end end function SetPanelVisible( Panel , Stats ) guiSetVisible(Panel,Stats) showCursor(Stats) end for _, MarkerCreate in pairs( PositionMarker ) do local xPos, yPos, zPos = MarkerCreate[1], MarkerCreate[2], MarkerCreate[3] Marker = createMarker(xPos, yPos, zPos-2,'cylinder',2,255,255,255) addEventHandler('onClientMarkerHit',root, function ( hPlayer ) if ( source == Marker ) and ( hPlayer == localPlayer ) and ( not isPedInVehicle(hPlayer) ) then SetPanelVisible( GUIEditor.window[1] , true ) end end ) addEventHandler('onClientMarkerLeave',root,function ( hPlayer ) if ( source == Marker ) and ( hPlayer == localPlayer) then SetPanelVisible( GUIEditor.window[1] , false ) end end ) end setBlipVisibleDistance( createBlipAttachedTo(Marker,55) , 1000 ) GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[1] = guiCreateWindow(246, 166, 285, 370, "Vehicle Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) VehShopGrid = guiCreateGridList(9, 21, 265, 150, false, GUIEditor.window[1]) local colm = guiGridListAddColumn(VehShopGrid, "Vehicles", 0.9) guiGridListClear (VehShopGrid) for _, v in pairs( VehiclesID ) do if getVehicleNameFromModel(v) ~= "" or nil then guiGridListSetItemText (VehShopGrid,guiGridListAddRow (VehShopGrid),colm,getVehicleNameFromModel(v), false, false ) end end YourB = guiCreateButton(9, 175, 134, 30, "Buy", false, GUIEditor.window[1]) YourGrideList = guiCreateGridList(9, 211, 265, 149, false, GUIEditor.window[1]) guiGridListAddColumn(YourGrideList, "Vehicles Me", 0.9) GUIEditor.button[2] = guiCreateButton(156, 175, 119, 30, "Close", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick",GUIEditor.button[2],function ( ) SetPanelVisible( GUIEditor.window[1] , false ) end , false ) function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) local text = guiGridListGetItemText ( gridList, item, column or 1 ) if ( text ~= '' ) then return text else return false end end addEventHandler("onClientGUIClick",YourB, function ( ) if ( getElementData(localPlayer,'VehicleMe') or 0 ) < 10 then if ( guiGridListGetSelectedItem(VehShopGrid ) ~= -1 ) then local Row, TextGride, xPos, yPos, zPos = guiGridListAddRow ( YourGrideList ) , guiGridListGetSelectedItemText( VehShopGrid ,colm ) ,getElementPosition(localPlayer) guiGridListSetItemText ( YourGrideList, Row, colm, TextGride, false, false ) local Vehicle = getVehicleIDFromName(TextGride) triggerServerEvent('CreateTheCar',localPlayer,Vehicle,xPos,yPos,zPos) guiGridListRemoveRow(VehShopGrid,guiGridListGetSelectedItem(VehShopGrid)) SetPanelVisible( GUIEditor.window[1] , false ) outputChatBox(getVehicleNameFromID(Vehicle) ) else outputChatBox("Error ",255,0,0) end else outputChatBox('لا يمكنك شراء اكثر من 10 سيارات',255,255,255) end end , false ) -- لتصفير الداتا لشراء سيارات كثيره addCommandHandler('Remove',function ( ) setElementData(localPlayer,'VehicleMe',0) end ) -- Server Vehicles = { } addEvent('CreateTheCar',true) addEventHandler('CreateTheCar',root, function( Vehicle, xPos,yPos,zPos ) if ( getElementInterior(source) == 0 ) and ( getElementDimension(source) == 0 ) then Vehicles[source] = createVehicle(Vehicle ,xPos, yPos+1, zPos+1) warpPedIntoVehicle(source,Vehicles[source]) setElementData(Vehicles[source], "Owner", true ) setElementData(source,'VehicleMe',(getElementData(source,'VehicleMe') or 0 ) + 1 ) end end ) Link to comment
iMr.WiFi..! Posted June 3, 2016 Share Posted June 3, 2016 نفس الخطأ عند سطر 75 غير كلمة YourB باسم ال button Link to comment
Maksoud Posted June 3, 2016 Author Share Posted June 3, 2016 شكرا اخوى انا كنت غلطان بشئ بسيط Link to comment
Maksoud Posted June 4, 2016 Author Share Posted June 4, 2016 setElementData(tc[source], "VehicleMe", true ) الكود ذه فيه خطأ Link to comment
iMr.WiFi..! Posted June 4, 2016 Share Posted June 4, 2016 setElementData(tc[source], "VehicleMe", true ) الكود ذه فيه خطأ لا Link to comment
Maksoud Posted June 4, 2016 Author Share Posted June 4, 2016 setElementData(tc[source], "VehicleMe", true ) الكود ذه فيه خطأ لا الدى بق يقول انه فيه خطأ Link to comment
iMr.WiFi..! Posted June 4, 2016 Share Posted June 4, 2016 setElementData(tc[source], "VehicleMe", true ) الكود ذه فيه خطأ لا الدى بق يقول انه فيه خطأ اطرح الكود كامل 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