DanielDsX Posted August 6, 2012 Share 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! Link to comment
Castillo Posted August 6, 2012 Share Posted August 6, 2012 There isn't as far as I know. Link to comment
DanielDsX Posted August 7, 2012 Author Share Posted August 7, 2012 is, I think I'll have to do it. Link to comment
Jaysds1 Posted August 7, 2012 Share 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. Link to comment
DanielDsX Posted August 7, 2012 Author Share 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 ) 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