Jump to content

مسأأعده


RdX

Recommended Posts

السلام عليكم

انا عندي كود

Rainbow Car <<

شغاأل 100 100

لكن مشكلته محد يشوف السيأأره تتلون الي يشوفها

بس الي ضغط الزر و بس يشوف سيأرته تتلون

انا ابيه يكون

root

يعني الي يلون سيأأأرته الناس تشوف سيأرته تتلون

Link to comment

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
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

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 by Guest
Link to comment
Client Side
function randomVehColors() 
    local vehicle = getPedOccupiedVehicle(localPlayer) 
        if (vehicle) then 
        triggerServerSide("color",getRootElement()) 
        end 
end 
addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors)-- ؟؟ getRootElement() مو لازم اسم الزر بدال  

Link to comment
Client Side
function randomVehColors() 
    local vehicle = getPedOccupiedVehicle(localPlayer) 
        if (vehicle) then 
        triggerServerSide("color",getRootElement()) 
        end 
end 
addEventHandler ( "onClientGUIClick", getRootElement(),randomVehColors)-- ؟؟ getRootElement() مو لازم اسم الزر بدال  

سوري انا شلته وبحط تحقق ونسيت المهم بعدله احين

Link to comment
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

مو شغأأل و الخطأأء

هنأأ

  
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 by Guest
Link to comment
  
  
--[[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
-- # 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...