/report{HOW}
#1

I cant get it right, im till so far:
pawn Код:
if(strcmp(cmd, "/report", true) == 0)
    {
            tmp = strtok(cmdtext,idx), tmp2 = strtok(cmdtext,idx);
            new player1, Reason;
            player1 = strval(tmp);
            Reason = strval(tmp2);
            if(!strlen(tmp) && !strlen(tmp2))
         {
             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report [playerid] [reason]");
         }
                        else
         {
            GetPlayerName(player1, playername, sizeof(playername));  GetPlayerName(playerid, adminname, sizeof(adminname));
            format(string,sizeof(string),"Thank you for your report, the online admins will check it!", playername, Reason);
            SendClientMessage(playerid, COLOR_GREEN, string);
            format(string,sizeof(string),"%s reported %s (Reason: %i)",adminname, playername, Reason);
            printf("%s has reported %s !(Reason: %i)",adminname, playername, Reason);

                }
                return 1;
}
Reply
#2

reason would be %s, %i = integer %s = string. reason would be a string in this case

Also;
format(string,sizeof(string),"Thank you for your report, the online admins will check it!", playername, Reason);
can be;
SendClientMessage(playerid, COLOR_GREEN, "Thank you for your report, the online admins will check it!");
Reply
#3

Thanks but how to send it to online admins?
Reply
#4

pawn Код:
format(string,sizeof(string),"%s has reported %s !(Reason: %i)",adminname, playername, Reason);
for(new i = 0;i < MAX_PLAYERS;i++)
{
    if(IsPlayerConnected(i) && pInfo[i][Admin] > 0) SendClientMessage(i,COLOR_GREEN,string);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)