Jump to content

ONE small QUESTION!


Timiimit

Recommended Posts

Posted

Hi!

:)

Why THE :evil: **** :evil: DO I GET AN :redhotevil: ERROR :redhotevil: THAT SAYS :arrow::arrow::arrow::arrow: "getPedOccupiedVehcle" HAS BAD ARGUMANT :?::?::?::?::?::?::?::?::?::?::?::?::?::?::?:

  
theVehicle = getPedOccupiedVehicle( source ) 
  

in game nickname: [GFL]TimiimiT

Posted

there is no source since you didnt use an event handler and a function...

you can put it inside a function and use a event for event parameters read the wiki

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted

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 ) 
  

in game nickname: [GFL]TimiimiT

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

Posted

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?

Website: http://www.twisted-gamers.net

Don't you just love the error messages in LUA?

notmem11.png

Posted

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

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