21.02.2014, 19:10
pawn Код:
command(unban, playerid, params[])
{
new giveplayername[24];
if(sscanf(params, "s[24]", giveplayername)) return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /unban [player name]");
mysql_format(sqldb, query, sizeof(query), "SELECT * FROM accounts WHERE accname ='%e' LIMIT 0, 1", giveplayername);
mysql_tquery(sqldb, query);
new rows = mysql_num_rows();
if(!rows)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "That player doesn't exists in server's database!");
}
if(rows == 1)
{
if(cache_get_row_int(0, 4, sqldb))
{
mysql_format(sqldb, query, sizeof(query), "UPDATE accounts SET banvar ='0' WHERE accname ='%e'", giveplayername);
mysql_tquery(sqldb, query);
}
if(cache_get_row_int(0, 4, sqldb)) return SendClientMessage(playerid, COLOR_LIGHTRED, " That player isn't banned!");
}
return 1;
}
What's wrong?