[Help]: /report command!
#1

Hello!

I have one problem! I made the /report command and I don't get any ERROR or WARNING, but ingame there aren't any names in my report and not the right IDs -.- Can someone check my code pls?

Code:

pawn Code:
CMD:report(playerid, params[])
{
    new targetid;
    new reason;
    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!");
    format(string, sizeof(string), "{80FF00}[REPORT]: {80FF00}%s(ID:%d) {00FF00}has Reported {80FF00}%s(ID:%d){00FF00}! {FF0000}|| {00FF00}Reason: {80FF00}%s", GetName(playerid), playerid, GetName(targetid), targetid, reason);
    SendAdminMessage(string);
    SCM(playerid, COLOR_GREEN, "[REPORT]: Report has been send to an Online Administrator(/admins)! Thanks for Reporting!");
    return 1;
}
Stocks:

pawn Code:
stock GetName(playerid)
{
    new
    name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

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

Bump
Reply
#3

You cannot bump except after 48 hours have passed. I beg you, read the rules please.
Reply
#4

Ok, sorry.
Reply
#5

Firstly add this: new reason[80];
Secondly what do you mean with this: there aren't any names in my report
Try remove the const thing: stock SendAdminMessage(string[])
Reply
#6

What sentence do you get when you use that command?
Reply
#7

Quote:
Originally Posted by HurtLocker
View Post
Firstly add this: new reason[80];
Secondly what do you mean with this: there aren't any names in my report
Try remove the const thing: stock SendAdminMessage(string[])
Well I get a report like this:

[REPORT]: (ID:105) has Reported (ID:115)! || Reason: Reason
It should be: [REPORT]: name1(ID:his right ID) has Reported name2(ID:his right ID)! || Reason: Reason
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)