21.03.2017, 18:26
(
Последний раз редактировалось Sibuscus; 22.03.2017 в 18:37.
)
I have this
When I use this in-game I get: That player doesn't exist!, even though they are in my database
PHP код:
CMD:oban(playerid, params[])// Banning offline players
{
new banned, AdminName[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], str[128], reason[32], query[128], rows;
GetPlayerRPName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(banned, PlayerName, sizeof(PlayerName));
if(PlayerInfo[playerid][Admin] > 3)
{
if(sscanf(params, "s[24]", PlayerName, reason)) return SendClientMessage(playerid, COLOR_DARKCORAL, "USAGE: /o(ffline)ban [Player NAME] [Reason]");
cache_get_row_count(rows);
if(rows > 0)
{
mysql_format(g_Sql, query, sizeof(query), "UPDATE `accounts` SET `isBanned` = 1 WHERE `Name` = '%e'", PlayerName);
mysql_tquery(g_Sql, query, "", "");
format(str, sizeof(str), "%s has offline banned %s. Reason: %s", AdminName, PlayerName, reason);
SendClientMessageToAll(COLOR_DARKCORAL, str);
}
else
{
SendClientMessage(playerid, COLOR_DARKCORAL, "That player doesn't exist!");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKCORAL, "You cannot use this command!");
}
return 1;
}
SOLVED BY X337