Jump to content

Problem with userpanel


|MJK|SkyLord

Recommended Posts

I'm having a problem with an userpanel. it's saying 'Attempt to perform arithmetic on a boolean value.

serverside:

here is a part, it gives the problem at 'local PlayerTodayTime = math.floor((PlayerCheckTime - getElementData(thePlayer,"joinTime"))/1000)'

------ playedTime

local PlayerCheckTime = getTickCount ()

local PlayerTodayTime = math.floor((PlayerCheckTime - getElementData(thePlayer,"joinTime"))/1000)

local PlayerOldTime = loadPlayerData(thePlayer,"playedTime")

savePlayerData(thePlayer,"playedTime", PlayerOldTime + PlayerTodayTime)

CheckAchievement(thePlayer,6)

setElementData(thePlayer,"joinTime", PlayerCheckTime)

------

Link to comment
  • MTA Team

Means the player doesn't have "joinTime" data set correctly.

You could also try this:

local PlayerCheckTime = getTickCount() 
local PlayerTodayTime = math.floor((PlayerCheckTime - tonumber(getElementData(thePlayer, "joinTime")))/1000) 
local PlayerOldTime = loadPlayerData(thePlayer, "playedTime") 
savePlayerData(thePlayer, "playedTime", PlayerOldTime + PlayerTodayTime) 
CheckAchievement(thePlayer, 6) 
setElementData(thePlayer, "joinTime", PlayerCheckTime) 

Link to comment
Means the player doesn't have "joinTime" data set correctly.

You could also try this:

local PlayerCheckTime = getTickCount() 
local PlayerTodayTime = math.floor((PlayerCheckTime - tonumber(getElementData(thePlayer, "joinTime")))/1000) 
local PlayerOldTime = loadPlayerData(thePlayer, "playedTime") 
savePlayerData(thePlayer, "playedTime", PlayerOldTime + PlayerTodayTime) 
CheckAchievement(thePlayer, 6) 
setElementData(thePlayer, "joinTime", PlayerCheckTime) 

Thank you, i'll try it out

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