Fantanic Posted January 26, 2014 Share Posted January 26, 2014 (edited) Hello , I got a trucker job working fully now but i got one problem. If there is a respawn it respawns my trailer. So i would like to make the trailer not being respawn able. Edited February 2, 2014 by Guest Link to comment
Fantanic Posted January 28, 2014 Author Share Posted January 28, 2014 Im using K-Respawn Link to comment
MTA Team 0xCiBeR Posted January 28, 2014 MTA Team Share Posted January 28, 2014 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
Fantanic Posted January 29, 2014 Author Share Posted January 29, 2014 still need help Link to comment
Fantanic Posted January 30, 2014 Author Share Posted January 30, 2014 Maybe i got to use local model = (ids of all vehicles but not trailers) ? Link to comment
Fantanic Posted February 1, 2014 Author Share Posted February 1, 2014 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
Anubhav Posted February 2, 2014 Share Posted February 2, 2014 use it will respawn it. Click on it to go to wiki page. respawnVehicle Link to comment
Fantanic Posted February 2, 2014 Author Share Posted February 2, 2014 use it will respawn it. Click on it to go to wiki page. respawnVehicle I dont rlly get you , the respawnVehicle works fine , i just need it so it ignores the trailers Link to comment
TAPL Posted February 2, 2014 Share Posted February 2, 2014 (edited) if model ~= 435 or 450 or 591 then Should be: if model ~= 435 and model ~= 450 and model ~= 591 then You can also do: if getVehicleType(model) ~= "Trailer" then Edited February 2, 2014 by Guest Link to comment
Anubhav Posted February 2, 2014 Share Posted February 2, 2014 What do you mean? It will respawn vehicles only and what you mean by i just need it so it ignores the trailers Link to comment
Fantanic Posted February 2, 2014 Author Share Posted February 2, 2014 if model ~= 435 or 450 or 591 then Should be: if model ~= 435 and model ~= 450 and model ~= 591 then You can also do: if getVehicleType(model) ~= "Trailer" then Worked Thanks Link to comment
Fantanic Posted February 2, 2014 Author Share Posted February 2, 2014 U could also help me with giving me the functions of ; Making a gui to lock cars to classes / teams / usernames And that u can change upgrades + colors + a delete button so u can delete one. Greetings Link to comment
Anubhav Posted February 2, 2014 Share Posted February 2, 2014 --Making a gui guiCreateWindow guiCreateButton [url=https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#Vehicle_functions]https://wiki.multitheftauto.com/wiki/Se ... _functions[/url] Link to comment
Fantanic Posted February 2, 2014 Author Share Posted February 2, 2014 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
Anubhav Posted February 2, 2014 Share Posted February 2, 2014 [url=https://wiki.multitheftauto.com/wiki/SetVehicleLocked]https://wiki.multitheftauto.com/wiki/SetVehicleLocked[/url] -- to lock Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now