20.01.2016, 07:47
(
Последний раз редактировалось ChickenCrazy; 20.01.2016 в 09:07.
)
I just wanted to make that his ban go into SQLite but instead an error, Please help her [ REP + ]
" Simple Ban System & Ban SQLite "
HERE : PasteBin
Код:
CMD:banaccount(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessageEx(playerid, COLOR_GRAD1, "ADMIN : Anda di larang menggunakan CMD ini"); return 1; } new string[128], DBResult:result, Query[240], pName[24], reason[64], name[MAX_PLAYER_NAME], bannedby[MAX_PLAYER_NAME], datestring[24], timestring[24]; if(sscanf(params, "s[24]s[48]", pName, name, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /banaccount [name] [reason]"); format(Query, sizeof(Query), "SELECT `NAME` FROM `BANNED` WHERE `NAME` = '%s'", pName); result = db_query(bans, Query); if(doesAccountExist(name)) { OnPlayerOfflineLogin(name); if( CheckBan(name) == 1 ) { SendClientMessageEx( playerid, COLOR_WHITE, "Player telah di ban!" ); return 1; } if( PlayerInfo[MAX_PLAYERS][pAdmin] >= 2 ) { SendClientMessageEx( playerid, COLOR_WHITE, "Tidak bisa /banaccount id admin!" ); return 1; } PlayerInfo[MAX_PLAYERS][pWarns] += 3; if(PlayerInfo[MAX_PLAYERS][pWarns] >= 3) { new year, month,day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s (IP:%s) telah di offline banned oleh %s, alasan: %s (%d-%d-%d)", name, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), reason,month,day,year); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s telah di offline banned oleh %s, alasan: %s", name, GetPlayerNameEx(playerid), reason); ABroadCast(COLOR_LIGHTRED,string,2); PlayerInfo[MAX_PLAYERS][pBanned] = 1; GetPlayerName(playerid,bannedby,sizeof(bannedby)); format(string, sizeof(string),"had 3 Warning, reason: %s",reason); OnPlayerOfflineSave(name); return 1; } else if (!db_num_rows(result)) { new day, month, year, second, minute, hour; getdate(day, month, year), gettime(hour, minute, second); format(datestring, sizeof(datestring), "%i-%i-%i", day, month, year), format(timestring, sizeof(timestring), "%i:%i:%i", hour, minute, second); format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '0', '%s', '%s', '%s', '%s')", DB_Escape(pName), reason, DB_Escape(GetName(playerid)), datestring, timestring); result = db_query(bans, Query); if(result) { format(string, sizeof(string), "BAN: %s has been offline banned by %s(%d) due to %s", pName, GetName(playerid), playerid, reason); SendClientMessageToAll(-1, string), string = "\0"; printf("[ban] [%s]: offlinebanned %s due to %s", GetName(playerid), pName, reason); } else { format(string, sizeof(string), "SERVER: Failed to ban '%s'..", pName), SendClientMessage(playerid, -1, string); printf("[ban] [%s]: failed to offlineban %s due to %s", GetName(playerid), pName, reason); } db_free_result(result); return 1; } new year, month, day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s telah di offline banned oleh %s, reason: %s", name, GetPlayerNameEx(playerid), reason); ABroadCast(COLOR_LIGHTRED, string, 2); format(string, sizeof(string), "AdmCmd: %s telah di offline banned oleh %s, reason: %s (%d-%d-%d)", name, GetPlayerNameEx(playerid), reason,month, day, year); Log("logs/admin.log", string); OnPlayerOfflineSave(name); return 1; } db_free_result(result); return 1; }
HERE : PasteBin