[iMr]-W[i]Fi,.! Posted May 3, 2016 Share Posted May 3, 2016 الحين انا مسوي لوب فاضي خلصت سويت اضافة سيارة داخل اللوب خلصت بس ابي اتحقق اذا داخل لوب فوق 1 سيارة يحذف السيارة الاولى ويضيف سيارة جديدة محاولتي vehicles = {} vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if #vehicles =< 1 then destroyElement(vehicles[1]) Link to comment
3NAD Posted May 3, 2016 Share Posted May 3, 2016 بما انك تبي تحقق وجود السيارة او لا , ليه تسوي تحقق بالكمية؟ if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then -- destroy end end Link to comment
billal Posted May 3, 2016 Share Posted May 3, 2016 الحين انا مسوي لوب فاضيخلصت سويت اضافة سيارة داخل اللوب خلصت بس ابي اتحقق اذا داخل لوب فوق 1 سيارة يحذف السيارة الاولى ويضيف سيارة جديدة محاولتي vehicles = {} vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if #vehicles =< 1 then destroyElement(vehicles[1]) ممكن توضح لنا اكتر Link to comment
[iMr]-W[i]Fi,.! Posted May 3, 2016 Author Share Posted May 3, 2016 يقولي من هنا تبدأ المشاكل , : vehicles = {} addEvent('CarVIP',true) addEventHandler('CarVIP',root,function() local x,y,z = getElementPosition(source) vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then destroyElement(vehicles.vehicle[source]) end end end) vehicles2 = {} addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root,function( ID ) local x,y,z = getElementPosition(source) vehicles2.vehicle[source] = createVehicle(ID,x+10,y,z) if vehicles2.vehicle[source] then if isElement ( vehicles2.vehicle[source] ) then destroyElement(vehicles2.vehicle[source]) end end end) اتمنى التصحيح Link to comment
Abdul KariM Posted May 3, 2016 Share Posted May 3, 2016 راجع الموضوع هذا راح يفيدكك https://forum.multitheftauto.com/viewtopic.php?f=160&t=98486&p=882628&hilit=%D9%85%D8%A7%D8%B1%D9%83%D8%B1+%D9%85%D8%AE%D9%81%D9%8A+%D8%A8%D8%A7%D9%84%D8%A7%D8%B9%D8%A8#p882628 Link to comment
billal Posted May 3, 2016 Share Posted May 3, 2016 جرب كدا يا لوفي vehicles = {} -- Vehicle table addEvent('CarVIP',true) addEventHandler('CarVIP',root,function() local x,y,z = getElementPosition(source) vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then destroyElement(vehicles.vehicle[source]) vehicles[source] = nil end end end) vehicles2 = {} addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root,function( ID ) local x,y,z = getElementPosition(source) vehicles2.vehicle[source] = createVehicle(ID,x+10,y,z) if vehicles2.vehicle[source] then if isElement ( vehicles2.vehicle[source] ) then destroyElement(vehicles2.vehicle[source]) vehicles[source] = nil end end end) Link to comment
YourMind Posted May 3, 2016 Share Posted May 3, 2016 vehicles = {} addEvent('CarVIP',true) addEventHandler('CarVIP',root,function() local x,y,z = getElementPosition(source) if isElement (vehicles[source]) then destroyElement (vehicles[source]) end vehicles[source] = createVehicle(411,x+10,y,z) end) vehicles2 = {} addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root,function( ID ) local x,y,z = getElementPosition(source) if isElement (vehicles2[source]) then destroyElement (vehicles2[source]) end vehicles2[source] = createVehicle(ID,x+10,y,z) end) Link to comment
iMr.WiFi..! Posted May 4, 2016 Share Posted May 4, 2016 جرب كدا يا لوفي vehicles = {} -- Vehicle table addEvent('CarVIP',true) addEventHandler('CarVIP',root,function() local x,y,z = getElementPosition(source) vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then destroyElement(vehicles.vehicle[source]) vehicles[source] = nil end end end) vehicles2 = {} addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root,function( ID ) local x,y,z = getElementPosition(source) vehicles2.vehicle[source] = createVehicle(ID,x+10,y,z) if vehicles2.vehicle[source] then if isElement ( vehicles2.vehicle[source] ) then destroyElement(vehicles2.vehicle[source]) vehicles[source] = nil end end end) كودك هريسس , تمام اشتغل كودك ي @DTC12 Link to comment
iMr.WiFi..! Posted May 4, 2016 Share Posted May 4, 2016 طيب انا حاولت اسوي خاصية الحذف ولاقدرت محاولتي addEvent('Destroy',true) addEventHandler('Destroy',root,function() if #vehicles2 ~= 0 and #vehicles2 == 2 then Num = #vehicles2 - 1 destroyElement( vehicles2 [ Num ] ) table.remove( vehicles2, Num) end end) Link to comment
3NAD Posted May 4, 2016 Share Posted May 4, 2016 طيب انا حاولت اسوي خاصية الحذف ولاقدرت محاولتي addEvent('Destroy',true) addEventHandler('Destroy',root,function() if #vehicles2 ~= 0 and #vehicles2 == 2 then Num = #vehicles2 - 1 destroyElement( vehicles2 [ Num ] ) table.remove( vehicles2, Num) end end) if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then -- destroy end end ماله داعي تعقد المسألة Link to comment
billal Posted May 4, 2016 Share Posted May 4, 2016 جرب كدا يا لوفي vehicles = {} -- Vehicle table addEvent('CarVIP',true) addEventHandler('CarVIP',root,function() local x,y,z = getElementPosition(source) vehicles.vehicle[source] = createVehicle(411,x+10,y,z) if vehicles.vehicle[source] then if isElement ( vehicles.vehicle[source] ) then destroyElement(vehicles.vehicle[source]) vehicles[source] = nil end end end) vehicles2 = {} addEvent('CreateVehicle',true) addEventHandler('CreateVehicle',root,function( ID ) local x,y,z = getElementPosition(source) vehicles2.vehicle[source] = createVehicle(ID,x+10,y,z) if vehicles2.vehicle[source] then if isElement ( vehicles2.vehicle[source] ) then destroyElement(vehicles2.vehicle[source]) vehicles[source] = nil end end end) كودك هريسس , تمام اشتغل كودك ي @DTC12 شكرا 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