RdX Posted April 27, 2014 Share Posted April 27, 2014 السلام عليكم انا عندي كود Rainbow Car << شغاأل 100 100 لكن مشكلته محد يشوف السيأأره تتلون الي يشوفها بس الي ضغط الزر و بس يشوف سيأرته تتلون انا ابيه يكون root يعني الي يلون سيأأأرته الناس تشوف سيأرته تتلون Link to comment
RdX Posted April 27, 2014 Author Share Posted April 27, 2014 Rainbow Code ----ClientSide---- 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
!#NssoR_) Posted April 27, 2014 Share Posted April 27, 2014 خل اكواد الالوان و التايمر كلها بـ السيرفر لأن الكلنت مابيشوفها غيرك ولاتنسي تسوي table للتايمر .. Link to comment
</Mr.Tn6eL> Posted April 27, 2014 Share Posted April 27, 2014 Rainbow Code ----ClientSide---- 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) triggerServerEvent addEvent addEventHandler table Link to comment
ALw7sH Posted April 27, 2014 Share Posted April 27, 2014 (edited) Client Side function randomVehColors() if ( source == RianbowColor ) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then triggerServerSide("color",getRootElement()) end end end addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors) Server Side function Rcolor() 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 addEvent("color",true) addEventHandler("color",getRootElement(),function () setTimer( Rcolor, 350, 0 ) end,false) Edited April 27, 2014 by Guest Link to comment
KaduRo Posted April 27, 2014 Share Posted April 27, 2014 Client Side function randomVehColors() local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then triggerServerSide("color",getRootElement()) end end addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors)-- ؟؟ getRootElement() مو لازم اسم الزر بدال Link to comment
ALw7sH Posted April 27, 2014 Share Posted April 27, 2014 Client Side function randomVehColors() local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then triggerServerSide("color",getRootElement()) end end addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors)-- ؟؟ getRootElement() مو لازم اسم الزر بدال سوري انا شلته وبحط تحقق ونسيت المهم بعدله احين Link to comment
al-Kobra Posted April 27, 2014 Share Posted April 27, 2014 Client Side function randomVehColors() if ( source == RianbowColor ) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then triggerServerSide("color",getRootElement()) end end end addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors) triggerServerSide = X | V triggerServerEvent Link to comment
RdX Posted April 27, 2014 Author Share Posted April 27, 2014 (edited) مو شغأأل و الخطأأء هنأأ function Rcolor() 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 addEvent("color",true) addEventHandler("color",getRootElement(),function () setTimer( Rcolor, 350, 0 ) end,false) بأسطر رقم 8 Edited April 27, 2014 by Guest Link to comment
RdX Posted April 27, 2014 Author Share Posted April 27, 2014 --[[Client Side]]-- function randomVehColors() if ( source == RianbowColor ) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then triggerServerEvent("color",getRootElement()) end end end addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors) --[[server Side]]-- function Rcolor() 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 addEvent("color",true) addEventHandler("color",getRootElement(),function () setTimer( Rcolor, 350, 0 ) end,false) Link to comment
AboShanab Posted April 27, 2014 Share Posted April 27, 2014 -- # Client Side ! addEventHandler("onClientGUIClick", RianbowColor, function () if ( isPedInVehicle ( localPlayer ) ) then triggerServerEvent("onClickColor", localPlayer) else outputChatBox("* You Are Not In Car !", 255, 0, 0, true ) end end) -- # Server Side ! TimerColor = {} addEvent("onClickColor", true) addEventHandler("onClickColor", root, function () if ( isTimer ( TimerColor [ source ] ) ) then killTimer ( TimerColor [ source ] ) end TimerColor [ source ] = nil TimerColor [ source ] = setTimer ( setVehicleColor, 350, 0, getPedOccupiedVehicle( source ), math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ) end) addEventHandler("onPlayerWasted", root, function () if ( isTimer ( TimerColor [ source ] ) ) then killTimer ( TimerColor [ source ] ) end TimerColor [ source ] = nil end) addEventHandler("onPlayerQuit", root, function () if ( isTimer ( TimerColor [ source ] ) ) then killTimer ( TimerColor [ source ] ) end TimerColor [ source ] = nil 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