Ganz oben im Script:
new ReportCall[MAX_PLAYERS];
new JustReported[MAX_PLAYERS];
new PlayerNeedsHelp[MAX_PLAYERS];
#define DIALOG_REPORT 4597
Bei OnPlayerConnect Noch dashier rein:
PlayerNeedsHelp[playerid] = 0;
und
JustReported[playerid] = 0;
und
ReportCall[playerid] = 999;
Unter OnPlayerDisconnect dahier:
if(ReportCall[playerid] != 999)
{
new sendername[MAX_PLAYER_NAME], string[80];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[REPORT-SYSTEM] %s Hat den Server verlassen! /report geschlossen", sendername);
SendClientMessage(playerid, COLOR_LIGHTGREEN,string);
ReportCall[playerid] = 999;
}
Der Report Befehl:
if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(JustReported[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Bitte warte 30 Sekunden bis du den Nächsten Report schreiben kannst !");
return 1;
}
ShowPlayerDialog(playerid ,DIALOG_REPORT, DIALOG_STYLE_INPUT, "Einen Report senden","Du hast eine Frage oder möchtest einen Cheater melden?\nSchreibe denen Text hier rein:","Senden", "Abbrechen");
}
return 1;
}
Und dashier unter OnDialogResponse:
if(dialogid==DIALOG_REPORT)
{
if(response)
{
new stringrp[200];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(stringrp, sizeof(stringrp), "Report von: [ID:%d]%s", playerid, sendername);
ABroadCast(0xE19898AA,stringrp,1);
format(stringrp, sizeof(stringrp), "Meldung: %s", (result));
ABroadCast(0xE19898AA,stringrp,1);
ABroadCast(0xA04C4CAA,"Tippe '/ar [SpielerID]' or '/tr [SpielerID]'",1);
SendClientMessage(playerid, 0x96C184AA, " Dein Report wurde an alle Admins gesendet die Online sind.");
JustReported[playerid] = 1;
PlayerNeedsHelp[playerid] = 1;
SetTimerEx("ReportReset", 30000, false, "i", playerid);
}
}
Nun noch die Befehle:
if(strcmp(cmd, "/cr", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst Eingeloggt sein !");
return 1;
}
if(SpielerInfo[playerid][pAdmin] > 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /cr [SpielerID/SpielerName]");
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), "** Adminstrator [ID:%d]%s hat den Report geschlossen!", playerid, sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN, string);
format(string, sizeof(string), "** Du hast den /report geschlossen!", playerid, sendername);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
ReportCall[playerid] = 999;
ReportCall[giveplayerid] = 999;
}
}
}
}
}
if(strcmp(cmd, "/ar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst Eingeloggt sein !");
return 1;
}
if(SpielerInfo[playerid][pAdmin] > 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /ar [SpielerID/SpielerName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerNeedsHelp[giveplayerid] == 1)
{
PlayerNeedsHelp[giveplayerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "AdmWarnung: %s hat den Report von: [ID:%d]%s Angenommen.", sendername, giveplayerid, giveplayer);
ABroadCast(COLOR_YELLOW, string, 1);
SendClientMessage(playerid, COLOR_YELLOW,"Schreib nun mit dem Spieler per Chat du bist Automatisch Verbunden.");
SendClientMessage(playerid, COLOR_YELLOW,"Du kannst den Report mit '/cr [SpielerID/SpielerName]' schließen");
format(string, sizeof(string), "** Adminstrator [ID:%d]%s hat dein Report Angenommen, er wird dich nun Supporten.", playerid, sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN, string);
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN,"Du kannst nun per Chat mit dem Admin Schreiben.");
SendClientMessage(playerid, COLOR_LIGHTGREEN,"Du kannst nun per Chat mit dem Spieler Schreiben.");
ReportCall[giveplayerid] = playerid;
ReportCall[playerid] = giveplayerid; //Verbinde zum Reporter
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler hat keine Report anfrage !");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Administrator ! ");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/tr", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst Eingeloggt sein !");
return 1;
}
if(SpielerInfo[playerid][pAdmin] > 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /tr [SpielerID/SpielerName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerNeedsHelp[giveplayerid] == 1)
{
PlayerNeedsHelp[giveplayerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "AdmWarning: %s hat die /report Anfrage von [ID:%d]%s gelöscht.", sendername, giveplayerid, giveplayer);
ABroadCast(COLOR_YELLOW, string, 1);
format(string, sizeof(string), "** Administrator [ID:%d]%s hat deine /report Anfrage verweigert !", playerid, sendername);
SendClientMessage(giveplayerid, 0xB35959AA, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler hat keine Report anfrage !");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Administrator ! ");
return 1;
}
}
return 1;
}
Und Damit man auch Reden kann unter OnPlayerText dashier:
if(ReportCall[playerid] != 999)
{
new idx;
tmp = strtok(text, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[REPORT-SYSTEM] %s: %s", sendername, text);
SendClientMessage(playerid, COLOR_LIGHTGREEN,string);
if(ReportCall[ReportCall[playerid]] == playerid)
{
SendClientMessage(ReportCall[playerid], COLOR_LIGHTGREEN,string);
}
return 0;
}
Und damit man nach 30s auch wieder einen Report schreiben kann dashier unten ins Script:
forward ReportReset(playerid);
public ReportReset(playerid)
{
if(IsPlayerConnected(playerid))
{
if(JustReported[playerid] == 1)
{
JustReported[playerid] = 0;
}
}
}
xSpiderx
PS: Falls was falsch ist oder was fehlt melden.