Help with /reports Fast!
#1

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 ..
Reply
#2

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.
Reply
#3

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;
}
Reply
#4

i need /reports for check the reports not Report
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)