[Help]: report command!
#1

Hello!

I have another problem! I made the /report command and everything is ok, but an Admins don't get the report.

Code:

pawn Код:
CMD:report(playerid,params[])
{
    new
    name1[30],
    name2[30],
    targetid,
    string[200],
    reason[60];
    if(sscanf(params, "us[60]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid] [reason]");
    if(IsPlayerConnected(targetid))
    {
    SCM(playerid, COLOR_GREEN, "{80FF00}[Admin]: {00FF00}Your Report has been send to an online Administartor! Thank you for Reporting!");
    for(new i = 0; i < MAX_PLAYERS; ++i)
    {
    if(IsPlayerConnected(i) && !IsPlayerNPC(i) && pInfo[i][Adminlevel] > 0)
    {
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(targetid, name2, sizeof(name2));
    format(string, sizeof(string), "{80FF00}[REPORT]: {FF0000}%s(ID:%d) {00FF00}has Reported {FF0000}%s (ID:%d){00FF00}! {FF0000}|| {00FF00}Reason: {FF0000}%s{00FF00}.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
    SCM(i, COLOR_GREEN, string);
    GameTextForPlayer(i, "~w~New ~g~Report!", 3000, 5);
    }
    }
    }
    else
    {
    return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
    }
    return 1;
}
Thanks
Reply
#2

Here try this code.

pawn Код:
CMD:report(playerid,params[])
{
    new name1[30], name2[30], targetid, string[200], reason[60];
    if(sscanf(params, "us[60]", 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!");
    SCM(playerid, COLOR_GREEN, "{80FF00}[Admin]: {00FF00}Your Report has been send to an online Administartor! Thank you for Reporting!");
    for(new i = 0; i < MAX_PLAYERS; ++i)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i) && pInfo[i][Adminlevel] > 0)
        {
            GetPlayerName(playerid, name1, sizeof(name1));
            GetPlayerName(targetid, name2, sizeof(name2));
            format(string, sizeof(string), "{80FF00}[REPORT]: {FF0000}%s(ID:%d) {00FF00}has Reported {FF0000}%s (ID:%d){00FF00}! {FF0000}|| {00FF00}Reason: {FF0000}%s{00FF00}.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
            SCM(i, COLOR_GREEN, string);
            GameTextForPlayer(i, "~w~New ~g~Report!", 3000, 5);
        }
    }
    return 1;
}
And make sure are you admin or not.
Reply
#3

Still the same...
Reply
#4

EDIT: See code below.
Reply
#5

Oh i think i have found the problem. Try this code if it works let me know i'll explain it.

pawn Код:
CMD:report(playerid,params[])
{
    new name1[30], name2[30], targetid, string[200], reason[60];
    if(sscanf(params, "us[60]", 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!");
    SCM(playerid, COLOR_GREEN, "{80FF00}[Admin]: {00FF00}Your Report has been send to an online Administartor! Thank you for Reporting!");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i) && pInfo[i][Adminlevel] > 0)
        {
            GetPlayerName(playerid, name1, sizeof(name1));
            GetPlayerName(targetid, name2, sizeof(name2));
            format(string, sizeof(string), "{80FF00}[REPORT]: {FF0000}%s(ID:%d) {00FF00}has Reported {FF0000}%s (ID:%d){00FF00}! {FF0000}|| {00FF00}Reason: {FF0000}%s{00FF00}.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
            SCM(i, COLOR_GREEN, string);
            GameTextForPlayer(i, "~w~New ~g~Report!", 3000, 5);
        }
    }
    return 1;
}
Reply
#6

Not working :/
Reply
#7

Really the code above doesn't work? btw i changed the code. Try again if it doesn't work. Then i'm sure you aren't admin on your server.

or MAX_PLAYERS has little amount.
Reply
#8

I am an Admin...

[Player's Data]
Password = F7673F36E1290007B8D9231F2CA532947029F5
AdminLevel = 10
VIPLevel = 3
Money = 200
Scores = 0
Kills = 0
Deaths = 2
Reply
#9

Do you have Teamviewer? If you want i can fix them for you. Just PM me your ID and PW.
Reply
#10

Quote:
Originally Posted by MouseBreaker
Посмотреть сообщение
Do you have Teamviewer? If you want i can fix them for you. Just PM me your ID and PW.
No, but I can send you my code via PM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)