roddydennvor Posted April 10, 2015 Share Posted April 10, 2015 Hii there , i have some interior system , well .. I just want to make some features .... So when the player is offline then the interior is automaticly lock ... But how ? Please help me... Thx before... Your help will be appreciate Link to comment
Ryancit2 Posted April 10, 2015 Share Posted April 10, 2015 Try this: https://wiki.multitheftauto.com/wiki/OnClientPlayerQuit And in that event, attach a function which sets the interior locked. Since you didn't provided any code, i don't know how you made the lock system or you even made one or not. Link to comment
roddydennvor Posted April 11, 2015 Author Share Posted April 11, 2015 Hmm , i mean when the player exit game then all interior owned by the player is locked ... Can someone help me... ? Link to comment
Ryancit2 Posted April 11, 2015 Share Posted April 11, 2015 If there is a table like this: houses = { {'acc, houseID'}, {'acc, houseID'}, } Then it'll be easier, if you don't have such table then make one and then try something like this: function lockHouses(acc) for k, v in pairs (houses) do if v[1] == acc then lockInterior(v[2]) -- lockInterior() is another function which you should make on your own. return true end end end function quitHandler() local acc = getAccountName(getPlayerAccount(source)) lockHouses(acc) end addEventHandler("onClientPlayerQuit", root, quitHandler) Although this is just an 'idea' on how you should work around with such cases, tables are used alot. Also, since we don't have any sample from your current work, i'd just assume you have a pre-made lockInterior() function, otherwise make one if you know what it should be 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