SA-MP Forums Archive
Help with /reports Fast! - 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: Help with /reports Fast! (/showthread.php?tid=545629)



Help with /reports Fast! - Toxik - 09.11.2014

Hey guys i got this one Code for REPORT

pawn Код:
CMD:report(playerid, params[]) {
    new id;
    new reason[128];
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid,COLOR_RED, "[SERVER] - USAGE: /report [ID] [REASON]");
    new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(id, receiver, sizeof(receiver));
    format(string, sizeof(string), "[ADMIN] - %s(%d) has reported %s(%d)", sender, playerid, receiver, id);
    SendMessageToAdmins(string);
    format(string, sizeof(string), "[ADMIN] - Reason: %s", reason);
    SendMessageToAdmins(string);
    SendClientMessage(playerid, COLOR_RED, "Your report has been sent.");
    return 1;
}
stock SendMessageToAdmins(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, COLOR_RED, text);
        }
    }
}
how can i make /reports for only admins ..


Re: Help with /reports Fast! - dazman14 - 09.11.2014

I gather you either a) use a file system or b) use an mysql system. Either way please show me your Enum for account/character settings.


Re: Help with /reports Fast! - dazman14 - 09.11.2014

An example of something i'd make is adding this make it relevant to your enum:


Код:
CMD:report(playerid, params[]) {
if(Character[playerid][aRank] == 0)
{
     SendClientMessage(playerid,COLOR_RED, "Your not admin");
     return 1;
}

    new id;
    new reason[128];
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid,COLOR_RED, "[SERVER] - USAGE: /report [ID] [REASON]");
    new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(id, receiver, sizeof(receiver));
    format(string, sizeof(string), "[ADMIN] - %s(%d) has reported %s(%d)", sender, playerid, receiver, id);
    SendMessageToAdmins(string);
    format(string, sizeof(string), "[ADMIN] - Reason: %s", reason);
    SendMessageToAdmins(string);
    SendClientMessage(playerid, COLOR_RED, "Your report has been sent.");
    return 1;
}



Re: Help with /reports Fast! - Toxik - 09.11.2014

i need /reports for check the reports not Report


Re: Help with /reports Fast! - Dairyll - 09.11.2014

Quote:
Originally Posted by dazman14
Посмотреть сообщение
I gather you either a) use a file system or b) use an mysql system. Either way please show me your Enum for account/character settings.
What he said ^

Your /report system doesn't save the reports to any type of file/database from what I can see tho. Work on that first.