Report command
#1

Hey all. What's wrong with my report command?
It spams the chat with: Report Sended

pawn Code:
COMMAND:report(playerid,params[])
{
        new report[100];
        if(sscanf(params,"s",report)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/report [reason]");
        for(new admins;PlayerInfo[admins][pAdminLevel] < MAX_PLAYERS; admins++)
    {
        format(String,sizeof(String),"Report From %s REPORT:{6EF83C}%s",Name[playerid],report);
        SendClientMessage(admins,COLOR_ORANGE,String);
        SendClientMessage(playerid,COLOR_ORANGE,"Report Sended!");
    }
   
        return 1;
}
Reply
#2

pawn Code:
COMMAND:report(playerid,params[])
{
        new report[100];
        if(sscanf(params,"s[100]",report)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/report [reason]");
        for(new admins;PlayerInfo[admins][pAdminLevel] < MAX_PLAYERS; admins++)
    {
        format(String,sizeof(String),"Report From %s REPORT:{6EF83C}%s",Name[playerid],report);
        SendClientMessage(admins,COLOR_ORANGE,String);
        SendClientMessage(playerid,COLOR_ORANGE,"Report Sended!");
        break;
    }
   
        return 1;
}
This could help you.
Reply
#3

pawn Code:
COMMAND:report(playerid,params[])
{
        new report[100];
        if(sscanf(params,"s",report)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/report [reason]");
        for(new admins;admins < MAX_PLAYERS; admins++)
    {
        format(String,sizeof(String),"Report From %s REPORT:{6EF83C}%s",Name[playerid],report);
        SendClientMessage(admins,COLOR_ORANGE,String);
        SendClientMessage(playerid,COLOR_ORANGE,"Report Sended!");
    }
   
        return 1;
}
Try this
Reply
#4

Oh it did work but normal players are getting the report as well now
Reply
#5

Change this line:

pawn Code:
for(new admins;admins < MAX_PLAYERS; admins++)
Reply
#6

Oh I've fixed it. Thanks guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)