11.02.2017, 13:00
bump, can anybody help me? I now tried it with this but still the same error:
Код:
CMD:pban(playerid, params[]) { if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"Du musst ein Senior Supporter sein um diesen Command benutzen zu kцnnen."); new targetid, Reason[128]; if(sscanf(params, "ds", targetid, Reason)) return SendUsageMessage(playerid,"/pban [ID] [Grund]"); if(!IsPlayerConnected(targetid)) return SendErrorMessage(playerid,"Der gewдhlte Spieler ist nicht auf dem Server."); if(strlen(Reason) > 128) return SendErrorMessage(playerid,"Der gewдhlte Grund ist zu lang."); BanWithReason(playerid, targetid, Reason); return 1; } stock BanWithReason(playerid = INVALID_PLAYER_ID, targetid, reason[]) { new Query[240], string[112], DBResult:result, day, month, year, second, minute, hour, datestring[24], timestring[24]; 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); if(playerid != INVALID_PLAYER_ID) { format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", GetName(targetid), PlayerIP(targetid), reason, GetName(playerid), datestring, timestring); result = db_query(bans, Query); if(result) { format(string, sizeof(string), "BAN: %s(%d) wurde von %s(%d) gebannt [Grund: %s]", GetName(targetid), targetid, GetName(playerid), playerid, reason); SendClientMessageToAll(-1, string), string = "\0"; printf("[ban] [%s]: Erfolgreich %s's Bann Info hinzugefьgt", GetName(playerid), GetName(targetid)); } else { format(string, sizeof(string), "SERVER: Fehler beim Bannen von '%s'", GetName(targetid)); SendClientMessageToAll(-1, string), string = "\0"; printf("[ban] [%s]: Fehler beim hinzufьgen von %s's Bann Info", GetName(playerid), GetName(targetid)); } } /* else { format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '%s', '%s', 'Server', '%s', '%s')", DB_Escape(GetName(targetid)), DB_Escape(PlayerIP(targetid)), reason, datestring, timestring); result = db_query(bans, Query); format(string, sizeof(string), "BAN: %s(%d) has been banned by the Server due to %s", GetName(targetid), targetid, reason); SendClientMessageToAll(COLOR_RED, string), string = "\0"; } for anti-cheat purposes ^ */ Query = "\0", db_free_result(result); SetTimerEx("KickTimer", 100, false, "i", targetid); }