Jump to content

|Help| Respawning vehicles only +...


Fantanic

Recommended Posts

  • MTA Team

Try This:

  
function respawn() 
local accountname = getAccountName (getPlayerAccount(source)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
outputChatBox("***Respawning ALL Empty Vehicles In 10 Secs, get to your car to keep it***") 
setTimer(function () 
local vehicles = getElementsByType ( "vehicle" )  
for k, vehicle in ipairs ( vehicles ) do 
local model = getElementModel(vehicle) 
if model ~=  435 or 450 or  591 then 
if checkEmpty( vehicle ) then 
local seats = getVehicleMaxPassengers(vehicle) 
resetVehicleIdleTime ( vehicle )  
respawnVehicle ( vehicle ) 
end 
end 
end 
end, 10000, 1) 
end  
end 
addEvent( "respawn", true ) 
addEventHandler( "respawn", getRootElement(), respawn ) 

Link to comment

still need help

Also im want to try to make a gui to add and lock cars in-game

For example i use /carlock then i get a gui wich contains ; Vehicle Username (up to 5 usernames) , team , class , color , upgrades .

But i dont know wich functions i need to use.

Thank you

Link to comment
createVehicle 
addVehicleUpgrade 
getElementData / getTeamName / getPlayerAccount 
xmlLoadFile 
xmlSaveFile 
  

?

I dont get it from how to lock it + how to get it so it takes the vehicle u are in + from xmlloadfile + savefile , maybe its better to use SQL but i dont have any knowledge in scripts with sql (i dont know how to make it working with sql*)

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