RdX Posted June 22, 2013 Share Posted June 22, 2013 السلام عليكم انا عندي اكواد اول ما اشغل المود تشتغل على طول انا ما ابيها تشتغل على طول الى اذا ضغطت Button الاكواد : function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end setTimer( randomVehColors, 350, 0 ) Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end setTimer( randomVehColors, 350, 0 ) addEventHandler ( "onClientGUIClick", Button, randomVehColours ) غلطت في حرف تم التعديل Link to comment
iMr.Dawix~# Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end setTimer( randomVehColors, 350, 0 ) addEventHandler ( "onClientGUIClick", Button, randomVehColours ) غلطت في حرف تم التعديل التايمر بيستوي قبل ما تضغط function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", Button,function () setTimer( randomVehColors, 350, 0 ) end,false) button = بدله بأسم الزر حقك Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function () setTimer( randomVehColors, 350, 0 ) end,false) طيب ابيه لمن يضعط عليه يسحب من عنده 800 الف Link to comment
#Al-Ha[J]aRii Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function () setTimer( randomVehColors, 350, 0 ) end,false) طيب ابيه لمن يضعط عليه يسحب من عنده 800 الف takePlayerMoney Link to comment
iMr.Dawix~# Posted June 22, 2013 Share Posted June 22, 2013 (edited) takePlayerMoney + getPlayerMoney ^ اعتمد على نفسك سهل بس حطه تحت التايمر او فوقه اهم شيء داخل الفنكشن حق اذا ضغط الزر Edited June 22, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) local money = getPlayerMoney(thePlayer) if (money > 800) then takePlayerMoney ( player, 800 ) setTimer( randomVehColors, 350, 0 ) else killTimer( randomVehColors ) outputchatbox("* You dont have enough money",player,255,0,0) end end,false) Link to comment
iMr.Dawix~# Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) ------removed setTimer( randomVehColors, 350, 0 ) -------removed end,false) خله يعتمد شوي على نفسه ويسوي الكود Link to comment
#Al-Ha[J]aRii Posted June 22, 2013 Share Posted June 22, 2013 (edited) function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) local money = getPlayerMoney(thePlayer) if (money > 800) then takePlayerMoney ( player, 800 ) setTimer( randomVehColors, 350, 0 ) else killTimer( randomVehColors ) outputchatbox("* You dont have enough money",player,255,0,0) end end,false) outputChatBox Edited June 22, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) ------removed setTimer( randomVehColors, 350, 0 ) -------removed end,false) خله يعتمد شوي على نفسه ويسوي الكود احنا ما سوينا له الكودات اللي فوق؟ وأبششر أخليه يعتمد على نفسه المرهـ الثانية Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end outputchatbox("* You dont have enough money",player,255,0,0) outputChatBox function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) local money = getPlayerMoney(thePlayer) if (money > 800) then takePlayerMoney ( player, 800 ) setTimer( randomVehColors, 350, 0 ) else killTimer( randomVehColors ) outputChatBox("* You dont have enough money",player,255,0,0) end end,false) مشكور ع التنبيه ذذ Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 بس مو لزم تكون في ملف server ? Link to comment
iMr.Dawix~# Posted June 22, 2013 Share Posted June 22, 2013 function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function (player) ------removed setTimer( randomVehColors, 350, 0 ) -------removed end,false) خله يعتمد شوي على نفسه ويسوي الكود احنا ما سوينا له الكودات اللي فوق؟ وأبششر أخليه يعتمد على نفسه المرهـ الثانية خلاص ساعده بالمره الأولى عشان يفهم الطريقه والمره الثانيه يفهم + لو يبي يسحب فلوس تكون بملف سيرفر المفروض عشان ما يسحبها وهميه بعدين ترجع له triggerServerEvent--نقل للسيرفر getPlayerMoney----يجيب كم عدد فلوس اللاعب takePlayerMoney-------سحب فلوسه ^ Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 زي ما قال ضاوي حاول تتعلم بنفسك ذذ وزي ما قال triggerServerEvent--نقل للسيرفر getPlayerMoney----يجيب كم عدد فلوس اللاعب takePlayerMoney-------سحب فلوسه Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 طيب ذا الكود صح بدون سحب الفلوس او لا setTimer(function () local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then setVehicleColor(vehicle,math.random(255),math.random(153),math.random(3)) end end,350,0) addEventHandler ( "onClientGUIClick", RianbowColor,function (player) Link to comment
./BlackBird# Posted June 22, 2013 Share Posted June 22, 2013 طيب ذا الكود صح بدون سحب الفلوس او لا function ColorV() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then setVehicleColor(vehicle,math.random(255),math.random(153),math.random(3)) end end addEventHandler ( "onClientGUIClick", RianbowColor,setTimer(ClolrV,350,0)) Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 طيب ذا الكود لمن اشغله تتغير الوان سيارته لكن محد شوفه ليش function randomVehColors() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then setVehicleColor(vehicle,math.random(255),math.random(153),math.random(3)) end end addEventHandler ( "onClientGUIClick", RianbowColor,function () setTimer( randomVehColors, 350, 0 ) end,false) Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 خله كذا طيب ذذ زي اول function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function () setTimer( randomVehColors, 350, 0 ) end,false) Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 بس ذي تتغير كل السيارات انا لا ابي الي يضغط الزر و تتلون سيارته و الناس تشوفها وهي تتلون Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 ^^^^ function randomVehColors() local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( vehicle, color[1], color[2], color[3], color[4] ) end end addEventHandler ( "onClientGUIClick", RianbowColor,function () setTimer( randomVehColors, 350, 0 ) end,false) الحين جرب تم التعديل * أسف اسف الحين عدلت جرب ذذذذ 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