Anubhav Posted March 10, 2014 Share Posted March 10, 2014 Hello players. I have a question. How to jail by Wanted Points not level. Is thier a way. Like 1 wp = 1 second. Please help me! Rgds, Anubhav Link to comment
teQuilla Posted March 10, 2014 Share Posted March 10, 2014 How do you declare those wanted points or whatever ? If you mean wanted level , here it is function outputWantedLevel (player,command) local wantedLvl = getPlayerWantedLevel (player ) if wantedLvl == 5 then --jail end end addCommandHandler ( "wanted", outputWantedLevel ) Link to comment
Saml1er Posted March 10, 2014 Share Posted March 10, 2014 You mean putting players in jail if their wanted point is X? Link to comment
Anubhav Posted March 10, 2014 Author Share Posted March 10, 2014 Sam1er i meaned if i have 10 Wanted points and i get jailed that time . Then i will be jailed for 10 seconds. (1xWP) Is thier a way for it? Link to comment
teQuilla Posted March 10, 2014 Share Posted March 10, 2014 (edited) function getwp(player) local wp = getElementData(player,"wantedpoints") if wp == nil then setElementData(player,"wantedpoints",0) end if not wp == 0 then local seconds = sToMs(wp) jailTheDude(player,s) -- Oops , edit fail ._. end end -- Please note jailTheDude is not a real function , you should use your own.. function sToMs(s) -- 1 second is 1000 miliseconds local s = s*1000 return s end -- Should work ._. Edited March 10, 2014 by Guest Link to comment
Anubhav Posted March 10, 2014 Author Share Posted March 10, 2014 teQuilla THANKS ALOT! ALOT! Link to comment
teQuilla Posted March 10, 2014 Share Posted March 10, 2014 You're welcome , I spotted a mistake though. It was jailing the dude for the wanted points in miliseconds , just edited so it jails him for seconds. Check the new code Link to comment
Anubhav Posted March 10, 2014 Author Share Posted March 10, 2014 Hmm ok. I don't need it anymore because i managed to make a another with element data. 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