SA-MP Forums Archive
Can this be changed please, Thanks! - 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: Can this be changed please, Thanks! (/showthread.php?tid=299522)



Can this be changed please, Thanks! - seanny - 26.11.2011

Can these commands be changed that the admin also provides a reason
Example: Admin %s has trashed your report, Reason: %s

pawn Код:
if(strcmp(cmd, "/denyreport", true) == 0 || strcmp(cmd, "/drp", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(d)eny®e(p)ort [PlayerID/PartOfName]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "AdmCmd: %s has marked %s's report as: Invalid.", sendername, giveplayer);
                        ABroadCast(COLOR_LIGHTRED,string,1);
                        format(string, sizeof(string), "%s has marked your report as invalid, it will not be viewed.", sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that Command !");
                return 1;
            }
        }
        return 1;
    }



Re: Can this be changed please, Thanks! - Rob_Maate - 26.11.2011

pawn Код:
if(strcmp(cmd, "/denyreport", true) == 0 || strcmp(cmd, "/drp", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(d)eny®e(p)ort [PlayerID/PartOfName] [Reason]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /(d)eny®e(p)ort [PlayerID/PartOfName] [Reason]");
                            return 1;
                        }
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "AdmCmd: %s has marked %s's report as: Invalid. Reason: %s", sendername, giveplayer, result);
                        ABroadCast(COLOR_LIGHTRED,string,1);
                        format(string, sizeof(string), "%s has marked your report as invalid, Reason: %s", sendername, result);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that Command !");
                return 1;
            }
        }
        return 1;
    }



Re: Can this be changed please, Thanks! - seanny - 26.11.2011

Thanks! Rep+'ed