#F9SoOoL Posted June 1, 2017 Share Posted June 1, 2017 (edited) سلآم عليكم آبي ككود يحذف سيارةة اللاعب اذا بيآخذ سيآأرةة ثآنيةةء يعني .. اذا معههء سيآرةة وتركهآ ورآح بياخذ وحدةة ثآنيةة من المآركر يحذف القديمةة وينزلههء الجديدةة :] @#_iMr.[E]coo Edited June 1, 2017 by #F9SoOoL Link to comment
^iiEcoo'x_) Posted June 1, 2017 Share Posted June 1, 2017 إطرح إنشاء الماركر ولما يعطيه السيارة Link to comment
#F9SoOoL Posted June 1, 2017 Author Share Posted June 1, 2017 -- client side function markers () car1 = createMarker (928.70001220703, -2168, 12, 'cylinder', 3, 255, 0, 0, 255) end addEventHandler("onClientResourceStart", getRootElement(), markers) function carss (thePlayer) if ( source == car1 ) and ( getElementData(thePlayer, 'Group') == 'root' ) and not isPedInVehicle(thePlayer) then carwnd1 = guiCreateWindow(182, 81, 429, 425, "Choose a Car .. !", false) guiWindowSetSizable(carwnd1, false) buf = guiCreateButton(9, 35, 122, 44, "Buffalo", false, carwnd1) inf = guiCreateButton(10, 96, 122, 44, "Infernus", false, carwnd1) showCursor(true) end end addEventHandler("onClientMarkerHit", getRootElement(), carss) addEventHandler("onClientGUIClick", getRootElement(), function() if source == buf then triggerServerEvent ("buff", getLocalPlayer()) guiSetVisible(carwnd1,false) showCursor(false) end end) -- server side addEvent("buff",true) addEventHandler("buff", root, function () x,y,z = getElementPosition( source ) buffalo = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,buffalo) addVehicleUpgrade (buffalo, 1010) end) Link to comment
^iiEcoo'x_) Posted June 1, 2017 Share Posted June 1, 2017 local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) Link to comment
#F9SoOoL Posted June 1, 2017 Author Share Posted June 1, 2017 (edited) On 01/06/2017 at 15:25, #_iMr.[E]coo said: local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) Expand ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت @#_iMr.[E]coo Edited June 1, 2017 by #F9SoOoL Link to comment
Ismaeel_finer Posted June 1, 2017 Share Posted June 1, 2017 On 01/06/2017 at 16:15, #F9SoOoL said: ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت @#_iMr.[E]coo Expand بدك ضيف سيارات اخري ؟ local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402,400,420,410,405, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) @#F9SoOoL Link to comment
iMr.WiFi..! Posted June 1, 2017 Share Posted June 1, 2017 (edited) On 01/06/2017 at 16:15, #F9SoOoL said: ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت @#_iMr.[E]coo Expand local vehicle = { } local CarNumber = 0 addEvent("buff",true) addEventHandler("buff", root, function () --if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) CarNumber = CarNumber + 1; vehicle[source][CarNumber] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source][CarNumber]) addVehicleUpgrade (vehicle[source][CarNumber], 1010) end) Edited June 1, 2017 by iMr.WiFi..! Link to comment
Abdul KariM Posted June 1, 2017 Share Posted June 1, 2017 @iMr.WiFi..! المتغيرات بالسيرفر تكون للجميع Link to comment
iMr.WiFi..! Posted June 1, 2017 Share Posted June 1, 2017 On 01/06/2017 at 16:41, Abdul KariM said: @iMr.WiFi..! المتغيرات بالسيرفر تكون للجميع Expand يرسل المتغير من الكلاينت ؟ كأفضل خيار ؟ Link to comment
^iiEcoo'x_) Posted June 1, 2017 Share Posted June 1, 2017 جرب سوي كذا local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () if #vehicle[source] == 2 then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) Link to comment
iMr.WiFi..! Posted June 1, 2017 Share Posted June 1, 2017 On 01/06/2017 at 17:17, #_iMr.[E]coo said: جرب سوي كذا local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () if #vehicle[source] == 2 then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) Expand على حسب ظني ماراح يزبط لأنك بدلت القيمة كأنك سويت كذا Car = 1 ثم بدلته Car = 2 يعني ماسويت شيء ذذ Link to comment
^iiEcoo'x_) Posted June 1, 2017 Share Posted June 1, 2017 local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () vevehicle[source] = vehicle[source] + 1 if #vehicle[source] == 2 then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) كذا يزبط Link to comment
#F9SoOoL Posted June 2, 2017 Author Share Posted June 2, 2017 On 01/06/2017 at 18:36, #_iMr.[E]coo said: local vehicle = { } addEvent("buff",true) addEventHandler("buff", root, function () vevehicle[source] = vehicle[source] + 1 if #vehicle[source] == 2 then destroyElement ( vehicle[source] ) end x,y,z = getElementPosition( source ) vehicle[source] = createVehicle (402, x-7, y, z+1) warpPedIntoVehicle(source,vehicle[source]) addVehicleUpgrade (vehicle[source], 1010) end) كذا يزبط Expand ERROR: root\ms.lua:6: attempt to perform arithmetic on field '?'(a nil value) Link to comment
#BrosS Posted June 2, 2017 Share Posted June 2, 2017 On 02/06/2017 at 12:44, #F9SoOoL said: ERROR: root\ms.lua:6: attempt to perform arithmetic on field '?'(a nil value) Expand بدل سطر 7 ب vehicle[source] vevehicle اقصد Link to comment
#F9SoOoL Posted June 2, 2017 Author Share Posted June 2, 2017 (edited) On 02/06/2017 at 14:03, #BrosS said: بدل سطر 7 ب vehicle[source] vevehicle اقصد Expand بدلتها نفس المشكلةة ,, م يححذف الموتر الققديم .. وآزيدك من الششعر ببيت ؟ المموتر ذذ صآر م ينزل .. Edited June 2, 2017 by #F9SoOoL 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