SA-MP Forums Archive
[Help]: /report command! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help]: /report command! (/showthread.php?tid=441242)



[Help]: /report command! - Areax - 02.06.2013

Hello!

Here is my /report command...Everything works fine, but for reason I can write MAX. 5 characters, I don't know why

/report:
pawn Код:
CMD:report(playerid, params[])
{
    new targetid;
    new reason[60];
    new string[200];
    if(sscanf(params, "us", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
    if(!IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected.");
    SendClientMessage(playerid, COLOR_GREEN, "[SYSTEM]: Your Report have been send to an online Administartor (/admins)! Thank you For Reporting!");
    format(string, sizeof(string), "{80FF00}[REPORT]: {FB0435}%s(ID:%d) {00FF00}has Reported {FB0435}%s(ID:%d){00FF00}! {FB0435}|| {00FF00}Reason: {FB0435}%s", GetName(playerid), playerid, GetName(targetid), targetid, reason);
    SendAdminMessage(string);
    return 1;
}
SendAdminMessage:

pawn Код:
stock SendAdminMessage(const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(pInfo[i][Adminlevel] >= 1)
    SendClientMessage(i, -1, string);
    }
    return 1;
}
Thanks


Re: [Help]: /report command! - Littlehelper - 02.06.2013

pawn Код:
if(sscanf(params, "us[60]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
Try this.


Re: [Help]: /report command! - Areax - 02.06.2013

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
pawn Код:
if(sscanf(params, "us[60]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
Try this.
Still the same, thanks anyway.


Re: [Help]: /report command! - park4bmx - 02.06.2013

The total string is too big!
pawn Код:
CMD:report(playerid, params[])
{
    new targetid;
    new reason[96];
    new string[200];
    if(sscanf(params, "us[96]" ,targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
    if(!IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected.");
    SendClientMessage(playerid, COLOR_GREEN, "[SYSTEM]: Your Report have been send to an online Administartor (/admins)! Thank you For Reporting!");
    format(string, sizeof(string), "{80FF00}[REPORT]: {FB0435}%s(ID:%d) {00FF00}has Reported {FB0435}%s(ID:%d){00FF00}! {FB0435}|| {00FF00}Reason:", GetName(playerid), playerid, GetName(targetid), targetid);
    SendAdminMessage(string);
//2nd message
    format(string, sizeof string, "{FB0435}%s", reason);
    SendAdminMessage(string);
    return 1;
}



Re: [Help]: /report command! - Areax - 02.06.2013

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
The total string is too big!
pawn Код:
CMD:report(playerid, params[])
{
    new targetid;
    new reason[96];
    new string[200];
    if(sscanf(params, "us[96]" ,targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
    if(!IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected.");
    SendClientMessage(playerid, COLOR_GREEN, "[SYSTEM]: Your Report have been send to an online Administartor (/admins)! Thank you For Reporting!");
    format(string, sizeof(string), "{80FF00}[REPORT]: {FB0435}%s(ID:%d) {00FF00}has Reported {FB0435}%s(ID:%d){00FF00}! {FB0435}|| {00FF00}Reason:", GetName(playerid), playerid, GetName(targetid), targetid);
    SendAdminMessage(string);
//2nd message
    format(string, sizeof string, "{FB0435}%s", reason);
    SendAdminMessage(string);
    return 1;
}
Thanks REP+