[Help]: /report command!
#1

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
Reply
#2

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

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.
Reply
#4

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;
}
Reply
#5

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+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)