Instead of using a boolean value, you should instead set the ban duration using a
unix timestamp. For a permanent ban set it to 2,000,000,000 or something way in the future, or the max value of a signed 32-bit long, 2,147,483,647 (01/19/2038 @ 3:14am)
Suppose the below for a 1 day ban, this is accurate down to the second in time:
- Now = 1600899052
- Ban expiration = 1600985452 (Now + 1 day (86400 seconds))
The ban will automatically lift after the current time reaches the ban expiration time:
PHP Code:
if ( PlayersBanTimeValue > get_systime() )
//Sorry, you're banned , it will expire in (PlayersBanTimeValue - get_systime()) seconds
else
//Ban has expired, player can join
You could always lift the ban by setting the ban expiration to 0, or by deleting the record.
__________________