Report System
#8

me nab xD
PHP код:
 mysql_tquery(mysqlQuery"Reports""i"playerid); // to read if player account exist 
PHP код:
forward Reports1(playerid);
public 
Reports1(playerid) { 
Reports called Report1 showed lol omg xD

PHP код:
CMD:reports(playerid,params[]) {
   if(
IsPlayerAdmin(playerid)) {
   new 
Query[250];
   
mysql_format(mysqlQuerysizeof(Query),"SELECT * FROM `reports` LIMIT 10"); // read player account
   
mysql_tquery(mysqlQuery"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 
rowsfields;
      
cache_get_data(rowsfieldsmysql);
      if(
rows) {
      new 
string[500];
      new 
Name[MAX_PLAYER_NAME+1],Reason[128],Date[128];
      
      
cache_get_field_content(0"Name"Namemysqlsizeof(Name));
      
cache_get_field_content(0"Reason"Reasonmysqlsizeof(Reason));
      
cache_get_field_content(0"Date"Datemysqlsizeof(Date));
      
format(string,sizeof string,"Name\tReason\tDate\n\%s\t%s\t%s",Name,Reason,Date);
      
ShowPlayerDialog(playerid, -1DIALOG_STYLE_TABLIST_HEADERS"Reports",string,"Exit""");
  }

in report you miss reporter name
PHP код:
    mysql_format(mysqlQuerysizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`,  `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate); 
should be like:
PHP код:
mysql_format(mysqlQuerysizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Reporter`, `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate); 
and the dialog / report 1 should be edited:
PHP код:
forward Reports1(playerid);
public 
Reports1(playerid) {
      new 
rowsfields;
      
cache_get_data(rowsfieldsmysql);
      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"Namemysqlsizeof(Name));
      
cache_get_field_content(0"Reason"Reasonmysqlsizeof(Reason));
      
cache_get_field_content(0"Reporter"Reportermysqlsizeof(Reporter));
      
cache_get_field_content(0"Date"Datemysqlsizeof(Date));
      
format(string,sizeof string,"Name\tReporter\tReason\tDate\n\%s\t%s\t%s\t%s",Name,Reporter,Reason,Date);
      
ShowPlayerDialog(playerid, -1DIALOG_STYLE_TABLIST_HEADERS"Reports",string,"Exit""");
  }

Reply


Messages In This Thread
Report System - by vassilis - 12.11.2015, 09:07
Re: Report System - by jlalt - 12.11.2015, 09:12
Re: Report System - by vassilis - 12.11.2015, 09:16
Re: Report System - by jlalt - 12.11.2015, 09:38
Re: Report System - by vassilis - 12.11.2015, 09:45
Re: Report System - by jlalt - 12.11.2015, 10:00
Re: Report System - by vassilis - 12.11.2015, 10:10
Re: Report System - by jlalt - 12.11.2015, 11:04
Re: Report System - by vassilis - 12.11.2015, 11:22
Re: Report System - by jlalt - 12.11.2015, 12:59

Forum Jump:


Users browsing this thread: 2 Guest(s)