Jump to content

Car spawn with custom handling


kewiiNNN

Recommended Posts

how to change this script so cars will spawn with custom handling? like i paste the code of a handling somewhere?

  
local cars = { 
    {429}, 
    {402}, 
    {541}, 
    {415}, 
    {480}, 
    {562}, 
    {587}, 
    {565}, 
    {411}, 
    {559}, 
    {603}, 
    {560}, 
    {506}, 
    {451}, 
    {558}, 
    {555}, 
    {477} 
} 
  
carmarker = createMarker( -2670.2495117188,632.93334960938,13.5, "cylinder", 1.5, 0, 0, 255, 210, root ) 
createBlipAttachedTo(carmarker,25) 
  
theVehicle = {} 
  
function carmarkerhit(hitElement) 
    if isElement(theVehicle[hitElement]) then return destroyElement(theVehicle[hitElement]) end     
    if  getElementType(hitElement) == "player" and not isPedInVehicle(hitElement) then 
  
          
        randomcar = math.random(#cars) 
        carid = cars[randomcar][1] 
        theVehicle[hitElement] = createVehicle(carid, -2674.5383300781,630.00115966797,13.862801551819, 0, 0, 90) 
        warpPedIntoVehicle(hitElement,theVehicle[hitElement]) 
    end 
end 
addEventHandler("onMarkerHit", carmarker, carmarkerhit) 

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