SA-MP Forums Archive
When /report on first word reports to Admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: When /report on first word reports to Admins (/showthread.php?tid=396803)



When /report on first word reports to Admins - Threshold - 02.12.2012

Hello,
Guys im having a problem with the /report command. For ex. If somebody reported like this '/report 0 running away' Only the word "Running" Would be reported, the rest is deleted. If somebody can fix this for me i will appreciate you and will add 2x rep to your account. Thanks!

pawn Код:
dcmd_report(playerid, params[])
{
    new tmp[256], idx;
    tmp = strtok(params, idx);
    if(!strlen(tmp)){
        SendClientMessage(playerid, 0x555252AA, "/report [id] [reason]");
        return 1;
    }else{
        new pid = strval(tmp);
        tmp = strrest(params, idx);
        if(!IsPlayerConnected(pid)){
            SendClientMessage(playerid, 0x555252AA, "Invalid Player");
            return 1;
        }else{
            if(!strlen(tmp)){
                SendClientMessage(playerid, 0x555252AA, "/report [id] [reason]");
                return 1;
            }else{
                new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[200];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(pid, name2, sizeof(name2));
                format(string, sizeof(string), "*%s(%d) reported %s(%d) for '%s'", name, playerid, name2, pid, tmp);
                for(new i=0; i<GetMaxPlayers(); i++){
                    if(IsPlayerConnected(i)){
                        if(IsPlayerAdmin(i)){
                            SendClientMessage(i, 0x555252AA, string);
                        }
                    }
                }
            }
        }
    }
    return 1;
}