Jump to content

Wanted Points


Anubhav

Recommended Posts

Posted

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 ) 

Posted

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?

Posted (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 by Guest
Posted

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 :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...