Turbesz Posted July 6, 2021 Posted July 6, 2021 I created a jail system. And i added a command which prints out how much time is left out of jail. If I'll put myself in jail the command prints good value, but if i'll put another player in jail, the command prints the other player's time to me as well... My code parts: -- This is the jail part with the setTimer: local bortonzottek = { } local timer = {} timer[getPlayerSerial ( target )] = setTimer ( unJailoz, milliseconds, 1, target ) bortonzottek [ getPlayerSerial ( target ) ] = { milliseconds, timer[getPlayerSerial(target)] } --And this is the command: function teszt(thePlayer) local serial = getPlayerSerial ( thePlayer ) local jailed = bortonzottek [ serial ] local hatra = getTimerDetails(jailed [ 2 ]) or 0 local string = string.format("%02d ", hatra/60) outputChatBox((math.floor ( hatra/60000 ) + 1)) end addCommandHandler("bido",teszt) The timer works fine, so let me out from the jail when my time is up and the other player when her timer expires, but the getTimerDetails does not work well... What wrong? How to fix this?
Moderators IIYAMA Posted July 8, 2021 Moderators Posted July 8, 2021 On 06/07/2021 at 12:13, Turbesz said: What wrong? outputChatBox outputs by default to all players. You need to specify the receiver. https://wiki.multitheftauto.com/wiki/OutputChatBox
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