EH10 Posted February 11, 2014 Share Posted February 11, 2014 بسم الله الرحمن الرحيم السلام عليكم ورحمة الله وبركاتة طلب فنكشات قريد ليست فيها اسماء سيارات لاضغطت على اسم سياره تروح فوق والسياره تحت ولما اضغط الثانية تجي سياره ثانية توضيح ثاني رحت فتحت الوحة ضغطت على اسم سياره بطير فوق يعني كاميرا وسياره تحتي على صوب السياره ولما اضغط بتتغير السياره ولما اضغط بتتغير ماحد يشوفها غيري واذا ضغطت اغلاق الوحة راخ يروح الكاميرا ويرجع للي Link to comment
al-Kobra Posted February 11, 2014 Share Posted February 11, 2014 createVehicle 'onClientMarkerHit' guiSetVisible showCursor setCameraMatrix guiGridListGetItemData getElementModel setElementModel setTimer > setElementHealth -- هذي عشان اذا احد ضرب السيارة ما يصيدها شي setElementFrozen -- تجمد السيارة 'onClientGUIClick' setCameraTarget #Edited لوول نسيت شي ض1 ,, setElementVisibleTo Link to comment
EH10 Posted February 11, 2014 Author Share Posted February 11, 2014 الـكـود صـح أو خـطـأ addEventHandler( "onClientMarkerHit", root, function() guiSetVisible ( name, true ) showCursor ( true ) local vehicles = getPlayerOccupiedVehicle ( source ) setElementFrozen( source, vehicles ) Camera = setCameraMatrix(source, x, y, x, y, x, y) end local cars = { {'Car1', 411 } } for i, car in ipairs( cars ) do row = guiGridListAddRow(Grid) guiGridListSetItemText(Grid, row, 1, car[1], false, false) guiGridListSetItemData(Grid, row, 1, car[2]) end addEventHandler( "onClientGUIClick", root, function () if ( source == Buttons ) then local Row, column = guiGridListGetSelectedItem ( Grid ) if ( Row and column and Row ~= -1 and column ~= -1 ) then local selct = tonumber( guiGridListGetItemData( Grid, guiGridListGetSelectedItem( Grid ) ) ) if selct and selct ~= '' then local Models = getElementModel( source, selct ) setElementModel ( localPlayer, selct ) setCameraTarget( source ) end end end end ) Link to comment
al-Kobra Posted February 11, 2014 Share Posted February 11, 2014 #Client Side * addEventHandler( "onClientMarkerHit", root, function() guiSetVisible ( name, true ) showCursor ( true ) mm = createVehicle ( 541, x, y, z ) triggerServerEvent( "lool",localPlayer,mm ) setElementFrozen( mm, true ) setTimer ( setElementHealth , 100, 0, mm, 1000 ) setCameraMatrix(source, x, y, z, x1, y1, z1) end function () local Row, column = guiGridListGetSelectedItem ( Grid ) local carName = guiGridListGetItemText (Grid, Row, column) local carID = getVehicleModelFromName (carName) if ( Row and column and Row ~= -1 and column ~= -1 ) then setElementModel ( mm, carID ) end end end local cars = { {"Bullet",541}, -- {carName,ID} } for i,car in ipairs (cars) do local row = guiGridListAddRow(carGridList) guiGridListSetItemText(carGridList,row,1,car[1],false,false) guiGridListSetItemData(carGridList,row,1,car[2]) end addEventHandler("onClientGUIClick",root, function() if source == buyButton then if guiGridListGetSelectedItem(carGridList) ~= -1 then local car = guiGridListGetItemData ( carGridList,guiGridListGetSelectedItem ( carGridList ), 1) local money = guiGridListGetItemData ( carGridList,guiGridListGetSelectedItem ( carGridList ), 2) triggerServerEvent("createcar",localPlayer,car) setCameraTarget( source ) elseif source == closeButton then guiSetVisible (carshopWindow, false) showCursor (false) setCameraTarget( source ) end end end ) #Server Side * addEvent("lool",true) addEventHandler("lool",root,function( mm ) setElementVisibleTo ( mm, source, true ) end ) local vehicle = {} addEvent("createcar",true) addEventHandler("createcar",root,function(car) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end local x,y,z = getElementPosition(source) vehicle[source] = createVehicle(tonumber(car),x,y,z) warpPedIntoVehicle(source,vehicle[source]) end end ) addEventHandler("onPlayerQuit",root,function() if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end 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