CMD:report(playerid,params[])
{
new reason[60],pid,Query[120],date,month,year;
getdate(year,month,date);
new ReportDate = getdate();
if(sscanf(params,"us[60]",pid,reason)) return SendClientMessage(playerid,COLOR_RED," SERVER : /report [id] [ reason ]");
if(pid == INVALID_PLAYER_ID || !IsPlayerConnected(pid)) return ErrorMessages(playerid,2);
SendFM(playerid,COLOR_LIGHTRED,"You have reported player %s(%d) Reason: %s",GPN(pid),pid,reason);
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%d')",GPN(pid),reason,GPN(playerid),ReportDate);
mysql_tquery(mysql,Query);
printf(Query);
foreach(new i: Player)
{
if(pinfo[i][Admin] >= 1)
SendFM(i,COLOR_WHITE,""COL_RED"PLAYER"COL_WHITE": %s(%d) "COL_RED"REPORTED"COL_WHITE":%s(%d) "COL_RED"REASON"COL_WHITE":%s(%d)",GPN(playerid),playerid,GPN(pid),pid,reason);
}
return 1;
}
CMD:report(playerid,params[])
{
new reason[60],pid,Query[120],date,month,year;
getdate(year,month,date);
new ReportDate = getdate();
if(sscanf(params,"us[60]",pid,reason)) return SendClientMessage(playerid,COLOR_RED," SERVER : /report [id] [ reason ]");
if(pid == INVALID_PLAYER_ID || !IsPlayerConnected(pid)) return ErrorMessages(playerid,2);
SendFM(playerid,COLOR_LIGHTRED,"You have reported player %s(%d) Reason: %s",GPN(pid),pid,reason);
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
mysql_tquery(mysql,Query);
printf(Query);
foreach(new i: Player)
{
if(pinfo[i][Admin] >= 1)
SendFM(i,COLOR_WHITE,""COL_RED"PLAYER"COL_WHITE": %s(%d) "COL_RED"REPORTED"COL_WHITE":%s(%d) "COL_RED"REASON"COL_WHITE":%s(%d)",GPN(playerid),playerid,GPN(pid),pid,reason);
}
return 1;
}
CMD:reports(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `reports` LIMIT 10"); // read player account
mysql_tquery(mysql, Query, "Reports", "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 Reports1(playerid);
public Reports1(playerid) {
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows) {
new string[500];
new Name[MAX_PLAYER_NAME+1],Reason[128],Date[128];
cache_get_field_content(0, "Name", Name, mysql, sizeof(Name));
cache_get_field_content(0, "Reason", Reason, mysql, sizeof(Reason));
cache_get_field_content(0, "Date", Date, mysql, sizeof(Date));
format(string,sizeof string,"Name\tReason\tDate\n\%s\t%s\t%s",Name,Reason,Date);
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_TABLIST_HEADERS, "Reports",string,"Exit", "");
}
}
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;
}
this should do the jop:
PHP код:
|
mysql_tquery(mysql, Query, "Reports", "i", playerid); // to read if player account exist
forward Reports1(playerid);
public Reports1(playerid) {
CMD:reports(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `reports` LIMIT 10"); // read player account
mysql_tquery(mysql, Query, "Reports1", "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 Reports1(playerid);
public Reports1(playerid) {
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows) {
new string[500];
new Name[MAX_PLAYER_NAME+1],Reason[128],Date[128];
cache_get_field_content(0, "Name", Name, mysql, sizeof(Name));
cache_get_field_content(0, "Reason", Reason, mysql, sizeof(Reason));
cache_get_field_content(0, "Date", Date, mysql, sizeof(Date));
format(string,sizeof string,"Name\tReason\tDate\n\%s\t%s\t%s",Name,Reason,Date);
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_TABLIST_HEADERS, "Reports",string,"Exit", "");
}
}
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Reporter`, `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
forward Reports1(playerid);
public Reports1(playerid) {
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows) {
new string[500];
new Name[MAX_PLAYER_NAME+1],Reason[128],Date[128],Reporter[[MAX_PLAYER_NAME+1];
cache_get_field_content(0, "Name", Name, mysql, sizeof(Name));
cache_get_field_content(0, "Reason", Reason, mysql, sizeof(Reason));
cache_get_field_content(0, "Reporter", Reporter, mysql, sizeof(Reporter));
cache_get_field_content(0, "Date", Date, mysql, sizeof(Date));
format(string,sizeof string,"Name\tReporter\tReason\tDate\n\%s\t%s\t%s\t%s",Name,Reporter,Reason,Date);
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_TABLIST_HEADERS, "Reports",string,"Exit", "");
}
}
function ServerReports(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows) {
new string[500];
new gName[MAX_PLAYER_NAME+1],Reason[128],Date[128];
cache_get_field_content(0, "Name", gName, sizeof(gName));
cache_get_field_content(0, "Reason", Reason, sizeof(Reason));
cache_get_field_content(0, "Date", Date, sizeof(Date));
format(string,sizeof string,"Name\tReason\tDate\n\%s\t%s\t%s",gName,Reason,Date);
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_TABLIST_HEADERS, "Reports",string,"Exit", "");
}
return 1;
}
CMD:report(playerid,params[])
{
new reason[60],pid,Query[120],date,month,year;
getdate(year,month,date);
new ReportDate = getdate();
if(sscanf(params,"us[60]",pid,reason)) return SendClientMessage(playerid,COLOR_RED," SERVER : /report [id] [ reason ]");
if(pid == INVALID_PLAYER_ID || !IsPlayerConnected(pid)) return ErrorMessages(playerid,2);
SendFM(playerid,COLOR_LIGHTRED,"You have reported player %s(%d) Reason: %s",GPN(pid),pid,reason);
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s')",GPN(pid),reason,ReportDate);
mysql_tquery(mysql,Query);
printf(Query);
foreach(new i: Player)
{
if(pinfo[i][Admin] >= 1)
SendFM(i,COLOR_WHITE,""COL_RED"PLAYER"COL_WHITE": %s(%d) "COL_RED"REPORTED"COL_WHITE":%s(%d) "COL_RED"REASON"COL_WHITE":%s(%d)",GPN(playerid),playerid,GPN(pid),pid,reason);
}
return 1;
}
CMD:reports(playerid,params[])
{
if(pinfo[playerid][Admin] < 1) return 0;
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `reports` LIMIT 10"); // read player account
mysql_tquery(mysql, Query, "ServerReports", "i", playerid); // to read if player account exist
return 1;
}
CMD:report(playerid,params[])
{
new reason[60],pid,Query[120];
if(sscanf(params,"us[60]",pid,reason)) return SendClientMessage(playerid,COLOR_RED," SERVER : /report [id] [ reason ]");
if(pid == INVALID_PLAYER_ID || !IsPlayerConnected(pid)) return ErrorMessages(playerid,2);
SendFM(playerid,COLOR_LIGHTRED,"You have reported player %s(%d) Reason: %s",GPN(pid),pid,reason);
new day1,month1,year1,Date1[128]; getdate(year1, month1, day1);
format(Date1,sizeof Date1,"%d-%d-%d",year1,month1,day1);
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s')",GPN(pid),reason,Date1);
mysql_tquery(mysql,Query);
printf(Query);
foreach(new i: Player)
{
if(pinfo[i][Admin] >= 1)
SendFM(i,COLOR_WHITE,""COL_RED"PLAYER"COL_WHITE": %s(%d) "COL_RED"REPORTED"COL_WHITE":%s(%d) "COL_RED"REASON"COL_WHITE":%s(%d)",GPN(playerid),playerid,GPN(pid),pid,reason);
}
return 1;
}
CMD:reports(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `reports`"); // read player account
mysql_tquery(mysql, Query, "Reports1", "i", playerid); // to read if player account exist
return 1;
} else return SendClientMessage(playerid,-1,"ERROR:You should be rcon to use this command");
}
forward Reports1(playerid);
public Reports1(playerid) {
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows) {
new string[128],handle[1000];
new Name1[MAX_PLAYER_NAME+1],Reason[128],Date[128];
strcat(handle,"Name\tReason\tDate");
if(cache_get_row_count(mysql) >= 10) {
cache_get_row(cache_get_row_count()-1, 0, Name1); cache_get_row(cache_get_row_count()-1, 2, Reason); cache_get_row(cache_get_row_count()-1, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-2, 0, Name1); cache_get_row(cache_get_row_count()-2, 2, Reason); cache_get_row(cache_get_row_count()-2, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-3, 0, Name1); cache_get_row(cache_get_row_count()-3, 2, Reason); cache_get_row(cache_get_row_count()-3, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-4, 0, Name1); cache_get_row(cache_get_row_count()-4, 2, Reason); cache_get_row(cache_get_row_count()-4, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-5, 0, Name1); cache_get_row(cache_get_row_count()-5, 2, Reason); cache_get_row(cache_get_row_count()-5, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-6, 0, Name1); cache_get_row(cache_get_row_count()-6, 2, Reason); cache_get_row(cache_get_row_count()-6, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-7, 0, Name1); cache_get_row(cache_get_row_count()-7, 2, Reason); cache_get_row(cache_get_row_count()-7, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-8, 0, Name1); cache_get_row(cache_get_row_count()-8, 2, Reason); cache_get_row(cache_get_row_count()-8, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-9, 0, Name1); cache_get_row(cache_get_row_count()-9, 2, Reason); cache_get_row(cache_get_row_count()-9, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
cache_get_row(cache_get_row_count()-10, 0, Name1); cache_get_row(cache_get_row_count()-10, 2, Reason); cache_get_row(cache_get_row_count()-10, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date); strcat(handle,string);
return ShowPlayerDialog(playerid, 3654, DIALOG_STYLE_TABLIST_HEADERS, "Reports",handle,"Exit", "");
}
if(cache_get_row_count() >= 10) {
cache_get_row(10, 0, Name1); cache_get_row(10, 2, Reason); cache_get_row(10, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 9) {
cache_get_row(8, 0, Name1); cache_get_row(8, 2, Reason); cache_get_row(8, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 8) {
cache_get_row(7, 0, Name1); cache_get_row(7, 2, Reason); cache_get_row(7, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 7) {
cache_get_row(6, 0, Name1); cache_get_row(6, 2, Reason); cache_get_row(6, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 6) {
cache_get_row(5, 0, Name1); cache_get_row(5, 2, Reason); cache_get_row(5, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 5) {
cache_get_row(4, 0, Name1); cache_get_row(4, 2, Reason); cache_get_row(4, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 4) {
cache_get_row(3, 0, Name1); cache_get_row(3, 2, Reason); cache_get_row(3, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 3) {
cache_get_row(2, 0, Name1); cache_get_row(2, 2, Reason); cache_get_row(2, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 2) {
cache_get_row(1, 0, Name1);cache_get_row(1, 2, Reason); cache_get_row(1, 3, Date);
format(string,sizeof string,"\n%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
if(cache_get_row_count() >= 1) {
cache_get_row(0, 0, Name1); cache_get_row(0, 2, Reason); cache_get_row(0, 3, Date);
format(string,sizeof string,"\n\%s\t%s\t%s\t%s",Name1,Reason,Date);
strcat(handle,string);}
ShowPlayerDialog(playerid, 3654, DIALOG_STYLE_TABLIST_HEADERS, "Reports",handle,"Exit", "");
}
if(!rows) {
SendClientMessage(playerid,-1,"There Are no Reports at this moment");
}
return 1;
}
CMD:dreport(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid,-1,"usage /dreport [name]");
new Query[250];
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `reports` WHERE `Name` = '%e'",params); // read player account
mysql_tquery(mysql, Query, "DeleteReport", "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 DeleteReport(playerid);
public DeleteReport(playerid){
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
new Query[250],Name1[MAX_PLAYER_NAME+1];
cache_get_field_content(0, "Name", Name1, mysql, sizeof(Name1));
format(Query, 100, "DELETE FROM `reports` WHERE `Name` = '%s'", Name1);
mysql_tquery(mysql, Query, "", "");
SendClientMessage(playerid,-1,"Report Successfully Deleted");
} if(!rows) {
return SendClientMessage(playerid,-1,"Name Not Exist on database");
}
return 1;
}