11.06.2018, 02:58
You can send update query and check the affected rows count
Then in the call back
PHP код:
/*Inside your ban command */
new query[75];
mysql_format(sql_connection, sizeof(query), "UPDATE player SET BANNED = 1 WHERE name = '%e'", name); //change the query according to your table structure
mysql_tquery(sql_connection, query, "OnBanPlayer","d", playerid); //Playerid of player who executed command is passed to callback so as to send client message
PHP код:
forward OnBanPlayer(whomexecuted);
public OnBanPlayer(whomexecuted)
{
if(!cache_affected_rows()) return SendClientMessage(whomexecuted, COLOR_RED, "This account does not exist.");
else
{
/*Ban the player...*/
SendClientMessage(whomexecuted, COLOR_RED, "Banned player successfully..");
return 1;
}
}