Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Dieses Script wurde von Azure und Easy am 28.04.2012 geschrieben
- public OnGameModeInit()
- {
- print("\n--------------------------------------");
- print(" Report System von Azure & Easy");
- print("--------------------------------------\n");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REPORT)
- {
- if(response == 1)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_BESCHWERDE,DIALOG_STYLE_INPUT,"Report System - Beschwerde","Gib bitte nun deine Beschwerde ein:","Bestätigen","Abbrechen");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,DIALOG_SUPPORT,DIALOG_STYLE_INPUT,"Report System - Support","Gib bitte nun deine Frage ein:","Bestätigen","Abbrechen");
- return 1;
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,DIALOG_BUG,DIALOG_STYLE_INPUT,"Report System - Bug Meldung","Gib bitte nun den Bug ein:","Bestätigen","Abbrechen");
- return 1;
- }
- }
- if(response == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_ABBRECHEN,DIALOG_STYLE_MSGBOX,"Report System - Abbrechen","Du verlässt nun das Report System!","Bestätigen","Zurück");
- }
- }
- if(dialogid == DIALOG_BESCHWERDE)
- {
- if(response == 1)
- {
- new string[128];
- SendClientMessage(playerid,orange,"Dein Beschwerde wurde abgespeichert und wurde an die Administratoren weitergeleitet!");
- format(string,sizeof(string),"[REPORT-SYSTEM]: %s hat eine Beschwerde eingesendet: [ %s ]",Name(playerid),inputtext);
- AdminNachricht(rot,string);
- SetPVarInt(playerid,"Report",1);
- }
- if(response == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_ABBRECHEN,DIALOG_STYLE_MSGBOX,"Report System - Abbrechen","Du verlässt nun das Report System!","Bestätigen","Zurück");
- }
- }
- if(dialogid == DIALOG_SUPPORT)
- {
- if(response == 1)
- {
- new string[128];
- SendClientMessage(playerid,orange,"Deine Support Anfrage wurde abgespeichert und wurde an die Administratoren weitergeleitet!");
- format(string,sizeof(string),"[REPORT-SYSTEM]: %s hat eine Support Anfrage eingesendet: [ %s ]",Name(playerid),inputtext);
- AdminNachricht(rot,string);
- SetPVarInt(playerid,"Report",1);
- }
- if(response == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_ABBRECHEN,DIALOG_STYLE_MSGBOX,"Report System - Abbrechen","Du verlässt nun das Report System!","Bestätigen","Zurück");
- }
- }
- if(dialogid == DIALOG_BUG)
- {
- if(response == 1)
- {
- new string[128];
- SendClientMessage(playerid,orange,"Deine Bug Meldung wurde abgespeichert und wurde an die Administratoren weitergeleitet!");
- format(string,sizeof(string),"[REPORT-SYSTEM]: %s hat eine Bug Meldung eingesendet: [ %s ]",Name(playerid),inputtext);
- AdminNachricht(rot,string);
- SetPVarInt(playerid,"Report",1);
- }
- if(response == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_ABBRECHEN,DIALOG_STYLE_MSGBOX,"Report System - Abbrechen","Du verlässt nun das Report System!","Bestätigen","Zurück");
- }
- }
- if(dialogid == DIALOG_ABBRECHEN)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_REPORT,DIALOG_STYLE_LIST,"Report System","Beschwerde\nSupport\nBug Meldung","Weiter","Abbrechen");
- }
- }
- return 1;
- }
- ocmd:report(playerid,params[])
- {
- ShowPlayerDialog(playerid,DIALOG_REPORT,DIALOG_STYLE_LIST,"Report System","Beschwerde\nSupport\nBug Meldung","Weiter","Abbrechen");
- return 1;
- }
- ocmd:oreport(playerid,params[])
- {
- new pID, string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,rot,"Du bist kein Admin und hast nicht das Recht Reports zu öffnen!");
- if(sscanf(params,"u",pID)) return SendClientMessage(playerid,weiß,"/oreport [ID]");
- format(string,sizeof(string),"** Administrator %s hat deinen Report geöffnet und bearbeitet ihn nun. Der Live Chat wurde aktiviert, nutze /rc!",Name(playerid));
- SendClientMessage(pID,orange,string);
- SendClientMessage(playerid,orange,"Du hast den Report geöffnet und beginnst den Live Chat, du schreibst mit /ra!");
- SetPVarInt(playerid,"LiveChat",1);
- SetPVarInt(pID,"LiveChat",1);
- SetPVarInt(pID,"Report",0);
- SetPVarInt(playerid,"RPartner",pID);
- SetPVarInt(pID,"RPartner",playerid);
- return 1;
- }
- ocmd:sreport(playerid,params[])
- {
- new pID, string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,rot,"Du bist kein Admin und hast nicht das Recht Reports zu schließen!");
- if(sscanf(params,"u",pID)) return SendClientMessage(playerid,weiß,"/sreport [ID]");
- format(string,sizeof(string),"** Administrator %s hat den Livechat beendet.",Name(playerid));
- SendClientMessage(pID,orange,string);
- SendClientMessage(playerid,orange,"Du hast den Report geschlossen!");
- SetPVarInt(playerid,"LiveChat",0);
- SetPVarInt(pID,"LiveChat",0);
- DeletePVar(playerid,"RPartner");
- DeletePVar(pID,"RPartner");
- return 1;
- }
- ocmd:lreport(playerid,params[])
- {
- new pID, string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,rot,"Du bist kein Admin und hast nicht das Recht Reports zu schließen!");
- if(sscanf(params,"u",pID)) return SendClientMessage(playerid,weiß,"/lreport [ID]");
- format(string,sizeof(string),"** Administrator %s hat deinen Report gelöscht!",Name(playerid));
- SendClientMessage(pID,orange,string);
- SendClientMessage(playerid,orange,"Du hast den Report gelöscht!");
- DeletePVar(pID,"Report");
- return 1;
- }
- ocmd:rc(playerid,params[])
- {
- new text[128],string[128],string1[128];
- if(GetPVarInt(playerid,"LiveChat") != 1) return SendClientMessage(playerid,rot,"Du bist in keinem Live Chat!");
- if(sscanf(params,"s",text)) return SendClientMessage(playerid,weiß,"/rc [text]");
- format(string,sizeof(string),"[LIVECHAT]: %s: %s",Name(playerid),text);
- SendClientMessage(GetPVarInt(playerid,"RPartner"),orange,string);
- format(string1,sizeof(string1),"[LIVECHAT]: %s: %s",Name(playerid),text);
- SendClientMessage(playerid,orange,string1);
- return 1;
- }
- ocmd:ra(playerid,params[])
- {
- new text[128],string[128],string1[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,rot,"Du bist kein Admin und hast nicht das Recht den Admin Report Chat zu nutzen!");
- if(GetPVarInt(playerid,"LiveChat") != 1) return SendClientMessage(playerid,rot,"Du bist in keinem Live Chat!");
- if(sscanf(params,"s",text)) return SendClientMessage(playerid,weiß,"/ra [text]");
- format(string,sizeof(string),"[LIVECHAT]: %s: %s",Name(playerid),text);
- SendClientMessage(GetPVarInt(playerid,"RPartner"),orange,string);
- format(string1,sizeof(string1),"[LIVECHAT]: %s: %s",Name(playerid),text);
- SendClientMessage(playerid,orange,string1);
- return 1;
- }
- ocmd:reports(playerid,params[])
- {
- #pragma unused params
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,rot,"Du bist kein Admin und hast nicht das Recht Reports zu sehen!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(GetPVarInt(i,"Report") == 1 && IsPlayerConnected(i))
- {
- new string[128];
- format(string,sizeof(string),"[REPORT-SYSTEM][OFFEN] Name: %s | ID: %i",Name(i), i);
- SendClientMessage(playerid,weiß,string);
- }
- }
- return 1;
- }
- ocmd:reporthilfe(playerid,params[])
- {
- #pragma unused params
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid,weiß,"Report Hilfe: /report /rc");
- return 1;
- }
- else
- {
- SendClientMessage(playerid,weiß,"Report Hilfe: /report /rc");
- SendClientMessage(playerid,weiß,"Report Hilfe: /sreport /oreport /lreport /reports");
- return 1;
- }
- }
- stock AdminNachricht(farbe,text[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && IsPlayerAdmin(i))
- {
- SendClientMessage(i,farbe,text);
- }
- }
- return 1;
- }
- stock Name(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- stock sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new changestr[16], changepos = 0, strpos = stringPos;
- while(changepos < 16 && string[strpos] && string[strpos] != delim)
- {
- changestr[changepos++] = string[strpos++];
- }
- changestr[changepos] = '\0';
- setarg(paramPos,0,_:floatstr(changestr));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
Add Comment
Please, Sign In to add comment