21.09.2015, 14:29
I've made a command to ban players and insert their data of ban to another table seprated from the users one
But when I got banned all the data of my account in the users table got removed except the date of register?!
PHP код:
new Day, Month, Year;
getdate(Year,Month,Day);
new TwBiNDb[128]; //Time will be inserted in Database
format(TwBiNDb, sizeof(TwBiNDb), "%i/%i/%i", Day, Month, Year);
format(string, sizeof(string), "INSERT INTO bans (PlayerBanned, BannedBy, reason, ip, time, unban, BanType) VALUES ('%s', '%s', '%s', '%s', '%s', '%i', '1')",PlayerName(targetid), PlayerName(playerid), reason, PlayerIP(targetid), TwBiNDb, unban);
mysql_query(1, string);
mysql_log(LOG_ALL);
new message[200];
format(message, sizeof(message), "%s has temporary banned by %s for %i day(s). Reason [%s]",PlayerName(targetid), PlayerName(playerid), time, reason);
SendClientMessageToAll(COLOR_RED, message);
SetTimerEx("ban", 500, false, "i", targetid);
printf("[MySql] %s", string);