Jump to content

احتاج مساعده


RdX

Recommended Posts

السلام عليكمم

شباب معي كود

Color Light Disco

و ابيه يشتغل بزر ما ابيه يشتغل بأمر

هذا الكود

local discoTimer = {} 
local discoState = {} 
  
function Disco(player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer(  
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
addCommandHandler("disco",Disco)--Disco (((())) 
  
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

Link to comment

local discoTimer = {} 
local discoState = {} 
  
function Disco(player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer( 
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
bindKey( player, "f2", "down", Disko )-Disco ((((:)))) 
  
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

بدل

* f2 = الزر اللي تبيه

Edited by Guest
Link to comment

local discoTimer = {} 
local discoState = {} 
addEventHandler ( "onClientGUIClick", DiscoLight,  
function (player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer( 
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
    end 
) 
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

تم التعديل تفضل الكود

Edited by Guest
Link to comment
local discoTimer = {} 
local discoState = {} 
addEventHandler ( "onClientGUIClick", btnOutput,  
function (player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer( 
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
    end 
) 
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

R50_كله سيم سيم يا :lol:

Link to comment
local discoTimer = {} 
local discoState = {} 
addEventHandler ( "onClientGUIClick", btnOutput,  
function (player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer( 
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
    end 
) 
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

R50_كله سيم سيم يا :lol:

ما شفت الرد حقه معليش :?

Edited by Guest
Link to comment
local discoTimer = {} 
local discoState = {} 
addEventHandler ( "onClientGUIClick", btnOutput,  
function (player,command) 
    local vehicle = getPedOccupiedVehicle(player) 
  if (vehicle) then 
    if discoState[player] == false then 
      discoState[player] = true 
      discoTimer[player] = setTimer( 
              function ( playerVehicle ) 
                  setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) 
              end 
          , 100, 0, vehicle ) 
          outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) 
    else 
      if discoTimer[player] then 
        killTimer( discoTimer[player] ) 
          discoTimer[player] = nil 
        discoState[player] = false 
        setVehicleHeadLightColor( vehicle, 255, 255, 255 ) 
      end 
    end 
    else 
        outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) 
    end 
end 
    end 
) 
function setStateOnStart() 
  for _, players in ipairs( getElementsByType( "player" ) ) do 
    discoState[players] = false 
  end 
end 
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); 
  
function setStateOnJoin() 
  discoState[source] = false 
end 
addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) 
  
function removeStateOnQuit() 
  discoState[source] = nil 
end 
addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) 

R50_كله سيم سيم يا :lol:

ما شفته الرد حقه معليش :?

عادي :wink:

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