Jump to content

can i do a swat with a single seat?


Andres99907

Recommended Posts

this is the script to lock the doors

function lockdoors ( theVehicle, seat )
    if ( getElementModel ( theVehicle ) == 601 ) then
         if isVehicleLocked ( playervehicle ) then      
         setVehicleLocked ( v, true )
    else 
         setVehicleLocked ( v, false )
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), lockdoors )

Link to comment
function lockcar ( thePlayer )
    playervehicle = getPedOccupiedVehicle ( thePlayer ) 	-- define 'playervehicle' as the vehicle the player is in
	 local id = getElementModel ( playervehicle )
    if id == 601 then
                               -- if a player is in a vehicle
        if isVehicleLocked ( playervehicle ) then            -- and if the vehicle is already locked
            setVehicleLocked ( playervehicle, false ) --unlock it	
        else                                                 -- otherwise (if it isn't locked) 
            setVehicleLocked ( playervehicle, true ) -- lock it
playSoundFrontEnd ( thePlayer, 46 ) --optional argument
        end
    end
end


function bindLockOnSpawn ( theSpawnpoint )                     -- when a player spawns
    bindKey ( source, "l", "down", lockcar )                   -- bind the 'l' key to the 'lockcar' function
end
addEventHandler ( "onPlayerSpawn", getRootElement(), bindLockOnSpawn ) 

when you respawn ( /kill ) the key going to be binded

and what happend with the fire of tank?

Edited by <~KaMiKaZe~>
  • Thanks 1
Link to comment
addEventHandler("onPlayerVehicleEnter",root,
function(vehicle)
  local id = getElementModel(vehicle)
  if id == 601 then
    setVehicleLocked(vehicle,true)
  end
end
)

addEventHandler("onPlayerVehicleExit",root,
function(vehicle)
  local id = getElementModel(vehicle)
  if id == 601 then
    setVehicleLocked(vehicle,false)
  end
end
)

 

Edited by ÆBKV
  • Like 1
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...