Jump to content

Calling function problem


xScatta

Recommended Posts

Hey guys. I have an problem because i want to call function with function like that

function lol()

if getVehicleController(blabla)=="player" -- this no matter -- then -- and there i want to call another function in the same script.lua--

my code

carm = createVehicle(579,1703.19,1039.09,10.89,0,0,90) 
  
function car() 
    vehiclem = getVehicleName(carm) 
    vehiclec = getVehicleController(carm) 
    if vehiclem=="huntley" 
        then outputChatBox("Teraz zawiez to auto do miejsca oznaczonego na mapie literka T", vehiclec)  
        createBlip(1235.79,212.88,19.55,255,0,0,255,0,99999.0,vehiclec) 
        end 
        end 
         
        addEventHandler("onClientPlayerVehicleEnter",carm,car) 
         
         
         
function check() 
if vehiclec=="player" then --HERE I WANT TO CALL car() function!-- 
  
  
end 
end 

Please fast post guys :)

Link to comment

Oh okay i will do it easier.

I want to do something like this

carm = createVehicle(579,1703.19,1039.09,10.89,0,0,90) 
  
function car() 
    vehiclem = getVehicleName(carm) 
    vehiclec = getVehicleController(carm) 
    if vehiclem=="huntley" 
        then outputChatBox("Teraz zawiez to auto do miejsca oznaczonego na mapie literka T", vehiclec)  
        createBlip(1235.79,212.88,19.55,255,0,0,255,0,99999.0,vehiclec) 
        end 
        end 
         
        addEventHandler("onClientPlayerVehicleEnter",carm,car) 
         
         
         
function check() 
if vehiclec=="player" then  
  
  
end 
end 

in the check function i want to make after "then" in "if vehiclec=="player" then" line a code which will run "car()" function.

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