GMT/Time is possibly no longer my problem, but...
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Don't use days/minutes etc to modify timestamps. Keep everything in seconds and it all becomes so much simpler.
My previous code was:

Код:
BanPlayer(playerid, bannerid, time[] = "PERMANENT", reason[] = "No Reasons Given")
{

if(strcmp(time, "PERMANENT", true))
	{
		mysql_format(sqlGameConnection, query, 256, "CREATE EVENT `%e` ON SCHEDULE %s DO DELETE FROM `bans` WHERE `username` = '%e'", name, time, name);
		mysql_query(sqlGameConnection, query, false);
		printf("%s %s %e", name, time, name);
	}

format(time, sizeof(time), "%d %s", day, time);
BanPlayer(id, playerid,time, reason);
But then I had way bigger problem. Well, I tested on localhost, when I /tban myself for 1 minute, I get unbanned after 1 minuet has passed. Same for days, hours...

But I implemented the script to main server and tried to ban my friend for one minute only, one minute has passed, he wasn't unbanned. I checked phpmyadmin, and in phpmyadmin there said that my friend will get unbanned after one hour. Same for hours, I banned him for 1 hour, in phpmyadmin it shows that he will get unbanned after 2 hours.
Could you please help me how can I fix that? I deleted my previous thread [GMT problem possibly]. I've no clue why is on loclhost working fine but in main server doesn't.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)