24.09.2016, 09:28
Using "u" specifier in /banreason command is imposibble because banned players can't login into the game.
Try this, i already removed GetName() because name variable is a player name already.
And use cache_delete() to remove cache
Try this, i already removed GetName() because name variable is a player name already.
And use cache_delete() to remove cache
Код:
CMD:banreason(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] <= 3) return 0; new name[24], query[128], string[128], reason[128]; if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /banreason [Player Name]"); format(query, sizeof(query), "SELECT `pReason` FROM `Users` WHERE `Name` = '%s'", name); new Cache:cquery; cquery = mysql_query(ServerMySQL, query); if(cache_num_rows()) { cache_get_field_content(0, "pReason", reason); if(!strcmp(reason, "", false, 1)) { format(string,sizeof(string), "[BAN REASON]: %s was banned for: %s", name, reason); SendClientMessage(playerid, COLOR_YELLOW, string); format(amsg,sizeof(amsg), "[Admin Log]: %s is requesting ban information on %s", GetName(playerid), name); // Rest of code here } else { SendClientMessage(playerid, COLOR_RED, "Error: That player isn't banned."); } } cache_delete(cquery); return 1; }