NextGenRP Posted April 29, 2012 Share Posted April 29, 2012 (edited) Ok first thing first, What do you think is better for RP; The vehicle disappears when the player logged out or the vehicle stays there after logout? also when trying to remove the vehicle i had a problem but no errors in the debug function onLogout(source) local vehs = getElementsByType("vehicle") for k,i in ipairs(vehs) do local owner = getElementData(i,"Owner") if owner == getAccountName(getPlayerAccount(source)) then destroyElement(i) end end end addEventHandler("onPlayerLogout", getRootElement(), onLogout) A player can have more than one vehicle btw. Any help is appreciated thanks. Edit: Updated the owner to account name. Edited April 30, 2012 by Guest Link to comment
Castillo Posted April 29, 2012 Share Posted April 29, 2012 Are you sure that you don't want to destroy the vehicles locked to his/her account name instead of player name? Link to comment
NextGenRP Posted April 29, 2012 Author Share Posted April 29, 2012 Yeah your right i just tested it, Going to need to change that now thanks, Updated the first post but still doesn't work. 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