Jump to content

Vehicle Gui


Gtagasje

Recommended Posts

Hi, I made a vehicle gui which will give you a vehicle if you press the button. And it works, but now I wan't it to warp you inside also,. This is what I have:

Server:

  
  
function createLS () 
     
    local LS = createVehicle ( 596, 1557.03284, -1605.92700, 13 ) 
  
end 
addEvent("PoliceLS",true) 
  
addEventHandler("PoliceLS", root, createLS) 
  
function createLV () 
  
    local LV = createVehicle ( 598, 1557.03284, -1605.92700, 13 ) 
     
end 
addEvent("PoliceLV",true) 
  
addEventHandler("PoliceLV", root, createLV) 
  
function createSF () 
  
    local SF = createVehicle ( 597, 1557.03284, -1605.92700, 13 ) 
     
end 
addEvent("PoliceSF",true) 
  
addEventHandler("PoliceSF", root, createSF) 
  
function createRan () 
  
    local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) and warpPedIntoVehicle ( Ran ) 
     
end 
addEvent("PoliceRan",true) 
  
addEventHandler("PoliceRan", root, createRan) 
  

I didn't add the client because I know warpPedIntoVehicle is serverside.

Link to comment

why your code has so much space?

function createLS () 
    local LS = createVehicle ( 596, 1557.03284, -1605.92700, 13 ) 
    warpPedIntoVehicle (source,LS) 
end 
addEvent("PoliceLS",true) 
addEventHandler("PoliceLS", root, createLS) 
  
function createLV () 
    local LV = createVehicle ( 598, 1557.03284, -1605.92700, 13 ) 
    warpPedIntoVehicle (source,LV) 
end 
addEvent("PoliceLV",true) 
addEventHandler("PoliceLV", root, createLV) 
  
function createSF () 
    local SF = createVehicle ( 597, 1557.03284, -1605.92700, 13 ) 
    warpPedIntoVehicle (source,SF) 
end 
addEvent("PoliceSF",true) 
addEventHandler("PoliceSF", root, createSF) 
  
function createRan () 
    local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) 
    warpPedIntoVehicle (source,Ran) 
end 
addEvent("PoliceRan",true) 
addEventHandler("PoliceRan", root, createRan) 
  

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