12.11.2015, 11:04
me nab xD
Reports called Report1 showed lol omg xD
in report you miss reporter name
should be like:
and the dialog / report 1 should be edited:
PHP код:
mysql_tquery(mysql, Query, "Reports", "i", playerid); // to read if player account exist
PHP код:
forward Reports1(playerid);
public Reports1(playerid) {
PHP код:
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", "");
}
}
PHP код:
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
PHP код:
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Reporter`, `Date`) VALUES ('%s', '%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
PHP код:
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", "");
}
}