Jump to content

[SCRIPT] Vehicle Spawn Gui


SkullBreaker

Recommended Posts

Hi guys!

I would like a GUI which pop-ups when you hit a marker, and then you can choose a few different vehicles.

So far I got this:

  
local marker = createMarker( 688.8, -1344.7, 12, "cylinder", 2, 0, 0, 255, 255 ) 
  
function spawnENF ( hitElement, matchingDimension ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        if ( not isPedInVehicle ( hitElement ) ) then 
            local x, y, z = getElementPosition ( hitElement ) 
            local ENF = createVehicle ( 427, x, y, z + 1, 0, 0, 180 ) 
            warpPedIntoVehicle ( hitElement, ENF ) 
        else 
            outputChatBox ( "You already got a vehicle!" ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", marker, spawnENF ) 
  

(This will only spawn one enforcer....)

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