Jump to content

ONE small QUESTION!


Timiimit

Recommended Posts

lua:

  
theVehicle = getPedOccupiedVehicle( source ) 
  
  
function rndColors() 
        local color = {} 
        color[1] = math.random(0,126) 
        color[2] = math.random(0,126) 
        color[3] = math.random(0,126) 
        color[4] = math.random(0,126) 
        setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) 
        outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) 
end 
  
function makeTimer() 
  
    if ( theVehicle == false ) then 
        outputChatBox ( "Get into a vehicle first!", getRootElement(), 255, 50, 0, true ) 
    else 
        setTimer( rndColors, 100, 1 ) 
        outputChatBox ( "You are in vehicle!!", getRootElement(), 255, 50, 0, true ) 
    end 
end 
addCommandHandler(" discovehicle", makeTimer ) 
  

Link to comment
  
local theVehicle = getPedOccupiedVehicle 
  
  
function rndColors() 
        local color = {} 
        color[1] = math.random(0,126) 
        color[2] = math.random(0,126) 
        color[3] = math.random(0,126) 
        color[4] = math.random(0,126) 
        setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) 
        outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) 
end 
  
function makeTimer() 
  
    if ( theVehicle == false ) then 
        outputChatBox ( "Get into a vehicle first!", getRootElement(), 255, 50, 0, true ) 
    else 
        setTimer( rndColors, 100, 1 ) 
        outputChatBox ( "You are in vehicle!!", getRootElement(), 255, 50, 0, true ) 
    end 
end 
addCommandHandler(" discovehicle", makeTimer ) 
  

Link to comment

Uhm, yeah...

  
  
  
  
function rndColors() 
        local color = {} 
        color[1] = math.random(0,126) 
        color[2] = math.random(0,126) 
        color[3] = math.random(0,126) 
        color[4] = math.random(0,126) 
        setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) 
        outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) 
end 
  
function makeTimer(player,command) 
    theVehicle = getPedOccupiedVehicle( player ) 
     
    if ( theVehicle == false ) then 
        outputChatBox ( "Get into a vehicle first!", player, 255, 50, 0, true ) 
    else 
        setTimer( rndColors, 100, 1 ) 
        outputChatBox ( "You are in vehicle!!", player, 255, 50, 0, true ) 
    end 
end 
addCommandHandler(" discovehicle", makeTimer ) 
  
  

Thar?

Link to comment

@NeXTreme your script will fail hard if more people type /discovehicle at the same time

  
function rndColors(player, theVehicle) 
        local color = {} 
        color[1] = math.random(0,126) 
        color[2] = math.random(0,126) 
        color[3] = math.random(0,126) 
        color[4] = math.random(0,126) 
        setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) 
        outputChatBox( "Enjoy the PARTY!", player, 0, 255, 0 ) 
end 
  
function makeTimer(player,command) 
    theVehicle = getPedOccupiedVehicle( player ) 
    
    if ( theVehicle == false ) then 
        outputChatBox ( "Get into a vehicle first!", player, 255, 50, 0, true ) 
    else 
        setTimer( rndColors, 100, 1, player, theVehicle ) 
        outputChatBox ( "You are in vehicle!!", player, 255, 50, 0, true ) 
    end 
end 
addCommandHandler("discovehicle", makeTimer ) 

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