PDA

View Full Version : /report sends out y with accent


AchievementMaster360
04/12/2013, 12:49 AM
So below is my /report command, I've been trying to fix it cause you needed and ID to report someone so now that i removed the ID it send out everything perfect exept the reportext, It sends a y with an accent

CMD:report(playerid, params[])
{
new reporttext[128];
if(sscanf(params, "us[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");
if(strlen(reporttext) > 64) return Error(playerid, "Your report text cannot be more than 64 characters");
if(PlayerInfo[playerid][pRMuted]) return Error(playerid, "You are currently muted from the reports system. Report not sent.");
if(GetPlayerActiveReport(playerid)) return Error(playerid, "You already have an active report. Please wait until it is closed out to re-report.");
new reportid = GetNewReportID();
if(reportid == INVALID_REPORT_ID) return Error(playerid, "There are currently too many reports in the system. Please try again in a few minutes.");
new q[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 24);
new time = gettime();
format(q, 256, "INSERT INTO reports (`reporter`, reporttext`, `time`, `accepted`, `resolved`, `rtime`) VALUES ('%s', '%s', %d, %d, %d, %d)", name, reporttext, time, 0, 0, 0);


new string[128];
format(STRING, "[RID: %d] Report from %s [%d] : %s", reportid, GetPlayerNameEx(playerid), playerid, reporttext);
SendAdminMessage(COLOR_ADMIN, string);
SendAdminText();
print(string);
format(STRING, "Your report has been sent to the admins. Please be paitient and wait until an admin can help you.");
Message(playerid, string);


Reports[reportid][rep_reporter] = playerid;
Reports[reportid][rep_text] = reporttext;
Reports[reportid][rep_time] = time;
Reports[reportid][rep_accepted] = 0;

return 1;
}

Loot
04/12/2013, 01:03 AM
Try: (you had 'STRING' instead of 'string' as defined)

format(string, "[RID: %d] Report from %s [%d] : %s", reportid, GetPlayerNameEx(playerid), playerid, reporttext);
format(string, "Your report has been sent to the admins. Please be paitient and wait until an admin can help you.");

AchievementMaster360
04/12/2013, 01:36 AM
Nope...

Loot
04/12/2013, 03:23 AM
Nope...
You've forgotten to remove the playerid selection via sscanf.

if(sscanf(params, "us[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");

To:

if(sscanf(params, "s[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");

[CG]Milito
04/12/2013, 03:27 AM
CMD:report(playerid, params[])
{
new reporttext[64];
if(sscanf(params, "s[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");
if(strlen(reporttext) > 64) return Error(playerid, "Your report text cannot be more than 64 characters");
if(PlayerInfo[playerid][pRMuted]) return Error(playerid, "You are currently muted from the reports system. Report not sent.");
if(GetPlayerActiveReport(playerid)) return Error(playerid, "You already have an active report. Please wait until it is closed out to re-report.");
new reportid = GetNewReportID();
if(reportid == INVALID_REPORT_ID) return Error(playerid, "There are currently too many reports in the system. Please try again in a few minutes.");
new q[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 24);
new time = gettime();
format(q, 256, "INSERT INTO reports (`reporter`, reporttext`, `time`, `accepted`, `resolved`, `rtime`) VALUES ('%s', '%s', %d, %d, %d, %d)", name, reporttext, time, 0, 0, 0);


new string[128];
format(STRING, "[RID: %d] Report from %s [%d] : %s", reportid, GetPlayerNameEx(playerid), playerid, reporttext);
SendAdminMessage(COLOR_ADMIN, string);
SendAdminText();
print(string);
format(STRING, "Your report has been sent to the admins. Please be paitient and wait until an admin can help you.");
Message(playerid, string);


Reports[reportid][rep_reporter] = playerid;
Reports[reportid][rep_text] = reporttext;
Reports[reportid][rep_time] = time;
Reports[reportid][rep_accepted] = 0;

return 1;
}

Your sscanf format was wrong.

You forgot to remove the ID parameter in your format

EDIT: Too late,

Tayab
04/12/2013, 03:29 AM
EDIT: Wops! Didn't see too many people already answered it!

if(sscanf(params, "us[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");


You removed the ID but you didn't remove the datatype in the sscanf line. Fixed below.


if(sscanf(params, "s[64]", reporttext)) return Syntax(playerid, "report", "[reporttext].");