DanielDsX Posted August 6, 2012 Posted August 6, 2012 Hello friends, I was wondering if there is a resource to lock the car by account. example: when the customer leaves the server the car remains locked until it comes back and unlock. if there please help me. grateful!
Castillo Posted August 6, 2012 Posted August 6, 2012 There isn't as far as I know. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jaysds1 Posted August 7, 2012 Posted August 7, 2012 well, it's easy, just set the car data using setElementData, after that, if the a player leaves/quit, check if he has a car by using getElementData, if he does then lock the car and set the players account data(setAccountData)(only if they was logged in). after each player login, and check if they have a car using getAccountData, if they do, then .... well that's up to you. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
DanielDsX Posted August 7, 2012 Author Posted August 7, 2012 I believe that the function is in this section. function cl_PlayerQuit ( ) -- check for owned car local ownedVehicle = getElementData ( source, "cl_ownedvehicle" ) if (ownedVehicle ~= false) then cl_RemoveVehicleOwner ( ownedVehicle ) end end addEventHandler ( "onPlayerQuit", getRootElement(), cl_PlayerQuit ) look here, to remove it when the customer leaves the server. cl_RemoveVehicleOwner ( ownedVehicle )
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