SA:MP server /report command
#1

How to create /report command with dialog? I use zcmd gamemode.
/report that sends an message to the admins, and admins can see this message, please help me.
Reply
#2

pawn Код:
CMD:report(playerid, params[])
{
    ShowPlayerDialog(playerid, 1571, DIALOG_STYLE_INPUT, "Report", "Type your report below to report it to the administrators online.", "Report", "Cancel");
    return 1;
}
And after the first { in OnDialogResponse, paste this code:

pawn Код:
if (dialogid == 1571 && response && inputtext[0])
{
    new playername[24], string[128 + 36];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "Report from %s: %s", playername, string);
    for (new i = 0; i < MAX_PLAYERS; i ++)
    {
        if (IsPlayerConnected(i) && PlayerInfo[i][pAdmin]) SendClientMessage(i, 0xFFFF00FF, string);
    }
    SendClientMessage(playerid, 0xFFFF00FF, "Thank you for submitting your report; it will be reviewed shortly.");
    return 1;
}
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)