12.11.2015, 10:00
this should do the jop:
PHP код:
CMD:dreport(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid,-1,"/dreport [Name]");
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * `reports` WHERE `Name` = '%e' LIMIT 1",params); // read player account
mysql_tquery(mysql, Query, "DReport", "i", playerid); // to read if player account exist
} else return SendClientMessage(playerid,-1,"ERROR:You should be rcon to use this command");
return 1;
}
forward DReport(playerid);
public DReport(playerid) {
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
new Query[250],Name[MAX_PLAYER_NAME+1];
cache_get_field_content(0, "Name", Name, mysql, sizeof(Name));
format(Query, 100, "DELETE FROM `bannedips` WHERE `Name` = '%s'", Name);
mysql_tquery(mysql, Query, "", "");
SendClientMessage(playerid,-1,"Report Successfully Deleted");
} if(!rows) {
return SendClientMessage(playerid,-1,"Reported Name Not Exist on database");
}
return 1;
}