Jump to content

Wanted


Resmurf

Recommended Posts

i tried making Online sesion and total online time and wanted stars but i just tried with wanted and got a error ;S

  
  
local starttick, currenttick 
local player = getLocalPlayer() 
addEventHandler("onClientRender",getRootElement(), 
    function() 
        if not starttick then 
            starttick = getTickCount() 
        end 
        currenttick = getTickCount() 
        if currenttick - starttick >= 1000 then 
            setElementData(player,"Wanted",getPlayerWantedLevel( player ) ) 
            starttick =  getTickCount() 
        end 
    end 
) 
function updatestars() 
    for k, v in ipairs(getElementsByType('player')) do 
        local Wanted = getPlayerWantedLevel(v) 
        setElementData(v,"Wanted",star ) 
    end 
end 
setTimer(updatestars, 1000000, 0) 
  

Help please

Link to comment
# function updatestars() 
     for k, v in ipairs(getElementsByType('player')) do 
         local star = getPlayerWantedLevel(v) 
         setElementData(v,"Wanted",star ) 
     end 
 end 
 setTimer(updatestars, 1000000, 0) 

Use this.

I think this will working and you defined WantedLevel to local Wanted but you should defined it local star then it works.

Link to comment

callServerFunction won't help. It doesn't return any value, so calling getPlayerWantedLevel in such way is useless. Just make a server-side script for setting element data value to wanted level. That's the easiest and the most efficient way.

Link to comment

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...