Question about Temp Banning (MySQL)
#7

When you ban them, you'll want to obtain the timestamp using gettime(). Just like that, gettime(), nothing else. Here's some pseudo code again:

pawn Код:
new iTimestamp = gettime();
Then, you'll want to do some calculations. If you want to ban them for 24 hours, then you'll need to add 24 hours to the timestamp. Keep in mind that a second is 1, a minute is 60, an hour is 3600 (try to keep up here), and there are 24 hours in a day (last time I checked), so 3600 * 24 = 86400. More pseudo code:

pawn Код:
iTimestamp = iTimestamp+86400;
Then you'll want to insert that value into a MySQL DB. When a player connects, check to make sure that if you do gettime() again, that the value of gettime() is greater than (>) the value you stored.

I can't make it much clearer than that!
Reply


Messages In This Thread
Question about Temp Banning (MySQL) - by Dokins - 23.01.2012, 20:51
Re: Question about Temp Banning (MySQL) - by [HiC]TheKiller - 23.01.2012, 21:20
Re: Question about Temp Banning (MySQL) - by Dokins - 23.01.2012, 21:24
Re: Question about Temp Banning (MySQL) - by Scenario - 23.01.2012, 21:28
Re: Question about Temp Banning (MySQL) - by Dokins - 23.01.2012, 21:30
Re: Question about Temp Banning (MySQL) - by Dokins - 23.01.2012, 21:50
Re: Question about Temp Banning (MySQL) - by Scenario - 23.01.2012, 21:51
Re: Question about Temp Banning (MySQL) - by Dokins - 23.01.2012, 21:54
Re: Question about Temp Banning (MySQL) - by Scenario - 23.01.2012, 22:27

Forum Jump:


Users browsing this thread: 2 Guest(s)