Advertisement
eXsses

DSYpwnReportFS v0.1 BETA

Jun 1st, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.78 KB | None | 0 0
  1. /*
  2. Diese Report-FS wurde von Dantesy & #PWN gescriptet.
  3. Es ist nicht erlaubt diesen Hinweis zu entfernen.
  4.  
  5. Bei Fragen:
  6. Skype: patrick.style45
  7.  
  8. */
  9.  
  10. #define FILTERSCRIPT
  11.  
  12. #define DIALOG_REPORT       1 // Die DialogID auf dein Script anpassen!
  13. #define DIALOG_FRAGE        2 // Die DialogID auf dein Script anpassen!
  14. #define DIALOG_BUG          3 // Die DialogID auf dein Script anpassen!
  15. #define DIALOG_BESCHWERDE   4 // Die DialogID auf dein Script anpassen!
  16. #define DIALOG_CHEATER      5 // Die DialogID auf dein Script anpassen!
  17.  
  18. #define COLOR_WEIß  0xF1F1F1FF
  19. #define COLOR_GRUEN 0x00C885FF
  20. #define COLOR_ROT   0xFF0000FF
  21.  
  22. #include <a_samp>
  23. #include <ocmd>
  24. #include <dini>
  25.  
  26. #if defined FILTERSCRIPT
  27.  
  28. public OnFilterScriptInit()
  29. {
  30.     print("\n--------------------------------------");
  31.     print(" DSYpwnReportFS v0.1 BETA by #PWN & Dantesy");
  32.     print("--------------------------------------\n");
  33.     return 1;
  34. }
  35.  
  36. #endif
  37.  
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40.     if(dialogid == DIALOG_REPORT)
  41.     {
  42.         if(response == 1)
  43.         {
  44.             if(listitem == 0)
  45.             {
  46.                 ShowPlayerDialog(playerid, DIALOG_FRAGE, DIALOG_STYLE_INPUT, "Report - Fragen", "Gebe hier deine Fragen ein\nDiese wird an einen Administrator gesendet", "Absenden", "Abbrechen");
  47.             }
  48.             else if(listitem == 1)
  49.             {
  50.                 ShowPlayerDialog(playerid, DIALOG_BESCHWERDE, DIALOG_STYLE_INPUT, "Report - Fragen", "Gebe hier deine Beschwerde ein\nDiese wird an einen Administrator gesendet", "Absenden", "Abbrechen");
  51.             }
  52.             else if(listitem == 2)
  53.             {
  54.                 ShowPlayerDialog(playerid, DIALOG_BUG, DIALOG_STYLE_INPUT, "Report - Fragen", "Gebe hier den Bug ein den du gefunden hast\nDieser wird an einen Administrator gesendet", "Absenden", "Abbrechen");
  55.             }
  56.             else if(listitem == 3)
  57.             {
  58.                 ShowPlayerDialog(playerid, DIALOG_CHEATER, DIALOG_STYLE_INPUT, "Report - Fragen", "Gebe hier den Spieler ein der angeblich Cheatet\nDieser wird an einen Administrator gesendet", "Absenden", "Abbrechen");
  59.             }
  60.         }
  61.         else
  62.         {
  63.             SendClientMessage(playerid, COLOR_GRUEN, "Du hast das Report-System beendet");
  64.         }
  65.     }
  66.     if(dialogid == DIALOG_FRAGE)
  67.     {
  68.         if(response == 1)
  69.         {
  70.             new string[128];
  71.             SendClientMessage(playerid,COLOR_GRUEN,"Du hast deine Frage an die Admins geschickt. Sie wird so schnell wie möglich bearbeitet.");
  72.             format(string,sizeof(string),"[REPORT-FRAGE]: Der Spieler %s hat eine Frage eingesendet: %s ",PlayerName(playerid),inputtext);
  73.             SendRconAdminMessage(COLOR_ROT,string);
  74.             SetPVarInt(playerid,"Ticket",1);
  75.         }
  76.         else
  77.         {
  78.             SendClientMessage(playerid, COLOR_GRUEN, "Du hast das Report-System beendet");
  79.         }
  80.     }
  81.     if(dialogid == DIALOG_BESCHWERDE)
  82.     {
  83.         if(response == 1)
  84.         {
  85.             new string[128];
  86.             SendClientMessage(playerid,COLOR_GRUEN,"Du hast deine Beschwerde an die Admins geschickt. Sie wird so schnell wie möglich bearbeitet.");
  87.             format(string,sizeof(string),"[REPORT-BESCHWERDe]: Der Spieler %s hat eine Beschwerde eingesendet: %s ",PlayerName(playerid),inputtext);
  88.             SendRconAdminMessage(COLOR_ROT,string);
  89.             SetPVarInt(playerid,"Ticket",1);
  90.         }
  91.         else
  92.         {
  93.             SendClientMessage(playerid, COLOR_GRUEN, "Du hast das Report-System beendet");
  94.         }
  95.     }
  96.     if(dialogid == DIALOG_BUG)
  97.     {
  98.         if(response == 1)
  99.         {
  100.             new string[128];
  101.             SendClientMessage(playerid,COLOR_GRUEN,"Du hast deine Bug-Meldung an die Admins geschickt. Sie wird so schnell wie möglich bearbeitet.");
  102.             format(string,sizeof(string),"[REPORT-BUG]: Der Spieler %s hat eine Bug-Meldung eingesendet: %s ",PlayerName(playerid),inputtext);
  103.             SendRconAdminMessage(COLOR_ROT,string);
  104.             SetPVarInt(playerid,"Ticket",1);
  105.         }
  106.         else
  107.         {
  108.             SendClientMessage(playerid, COLOR_GRUEN, "Du hast das Report-System beendet");
  109.         }
  110.     }
  111.     if(dialogid == DIALOG_CHEATER)
  112.     {
  113.         if(response == 1)
  114.         {
  115.             new string[128];
  116.             SendClientMessage(playerid,COLOR_GRUEN,"Du hast deine Cheater-Meldung an die Admins geschickt. Sie wird so schnell wie möglich bearbeitet.");
  117.             format(string,sizeof(string),"[REPORT-CHEATER]: Der Spieler %s hat eine Cheater-Meldung eingesendet: %s ",PlayerName(playerid),inputtext);
  118.             SendRconAdminMessage(COLOR_ROT,string);
  119.             SetPVarInt(playerid,"Ticket",1);
  120.         }
  121.         else
  122.         {
  123.             SendClientMessage(playerid, COLOR_GRUEN, "Du hast das Report-System beendet");
  124.         }
  125.     }
  126.     return 1;
  127. }
  128.  
  129. ocmd:report(playerid, params[])
  130. {
  131.     ShowPlayerDialog(playerid, DIALOG_REPORT, DIALOG_STYLE_LIST, "Report", "Fragen\nBeschwerden\nBugs\nCheater-Meldung", "Bestätigen", "Abbrechen");
  132.     return 1;
  133. }
  134.  
  135. ocmd:openreport(playerid, params[])
  136. {
  137.     new pID, string[128];
  138.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WEIß, "Du bist kein Admin!");
  139.     if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_WEIß, "Benutze: /openreport [playerid]");
  140.     format(string, sizeof(string), "Der Administrator %s(%d) hat dein Ticket geöffnet und bearbeitet es nun", PlayerName(playerid), playerid);
  141.     SendClientMessage(pID, COLOR_ROT, string);
  142.     SendClientMessage(pID, COLOR_ROT, "Du kannst mit dem Administrator reden indem du /rc benutzt");
  143.     SendClientMessage(pID, COLOR_ROT, "Du hast das Ticket von %s(%d) geöffnet du kannst nun mit /rc mit ihm schreiben");
  144.     SetPVarInt(pID, "Chat", 1);
  145.     SetPVarInt(playerid, "Chat", 1);
  146.     SetPVarInt(pID, "Report", 0);
  147.     SetPVarInt(playerid, "ChatPartner", pID);
  148.     SetPVarInt(pID, "ChatPartner", playerid);
  149.     return 1;
  150. }
  151.  
  152. ocmd:closereport(playerid, params[])
  153. {
  154.     new pID;
  155.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WEIß, "Du bist kein Admin!");
  156.     if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_WEIß, "Benutze: /closereport [playerid]");
  157.     SendClientMessage(pID, COLOR_ROT, "Der Administrator hat das Ticket geschlossen. Du kannst nichtmehr mit ihm reden.");
  158.     SendClientMessage(pID, COLOR_ROT, "Du hast das Ticket von %s(%d) geschlossen du kannst nun nichtmehr mit ihm reden.");
  159.     SetPVarInt(pID, "Chat", 0);
  160.     SetPVarInt(playerid, "Chat", 0);
  161.     DeletePVar(playerid, "ChatPartner");
  162.     DeletePVar(pID, "ChatPartner");
  163.     return 1;
  164. }
  165.  
  166. ocmd:delreport(playerid, params[])
  167. {
  168.     new pID;
  169.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WEIß, "Du bist kein Admin!");
  170.     if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_WEIß, "Benutze: /delreport [playerid]");
  171.     SendClientMessage(pID, COLOR_ROT, "Ein Administrator hat dein Ticket gelöscht.");
  172.     SendClientMessage(pID, COLOR_ROT, "Du hast das Ticket von %s(%d) gelöscht.");
  173.     DeletePVar(pID, "Ticket");
  174.     return 1;
  175. }
  176.  
  177. ocmd:rc(playerid, params[])
  178. {
  179.     new text, string[128];
  180.     if(GetPVarInt(playerid, "Chat") != 1) return SendClientMessage(playerid, COLOR_WEIß, "Du befindest dich nicht im Report-Chat");
  181.     if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_WEIß, "Benutze: /rc [Text]");
  182.     format(string, sizeof(string), "[REPORT-CHAT]: %s(%d): %s", PlayerName(playerid), playerid, text);
  183.     SendClientMessage(GetPVarInt(playerid, "ChatPartner"), COLOR_ROT, string);
  184.     format(string, sizeof(string), "[REPORT-CHAT]: %s(%d): %s", PlayerName(playerid), playerid, text);
  185.     SendClientMessage(playerid, COLOR_ROT, string);
  186.     return 1;
  187. }
  188.  
  189. ocmd:reporthelp(playerid, params[])
  190. {
  191.     SendClientMessage(playerid, COLOR_WEIß, "Report-Help[USERS]: /report /rc (/reportchat)");
  192.     if(IsPlayerAdmin(playerid))
  193.     {
  194.         //SendClientMessage(playerid, COLOR_WEIß, "Report-Help[USERS]: /report /rc (/reportchat)");
  195.         SendClientMessage(playerid, COLOR_WEIß, "Report-HELP[ADMIN]: /openreport /closereport /delreport /reports");
  196.     }
  197.     return 1;
  198. }
  199.  
  200. stock SendRconAdminMessage(color, msg[])
  201. {
  202.     for(new i = 0; i < MAX_PLAYERS; i++)
  203.     {
  204.         if(IsPlayerConnected(i) && IsPlayerAdmin(i))
  205.         {
  206.             SendClientMessage(i, color, msg);
  207.         }
  208.     }
  209. }
  210.  
  211. stock PlayerName(playerid)
  212. {
  213.     new Name[MAX_PLAYER_NAME];
  214.     GetPlayerName(playerid, Name, sizeof(Name));
  215.     return Name;
  216. }
  217.  
  218. stock sscanf(string[], format[], {Float,_}:...)
  219. {
  220.     #if defined isnull
  221.             if (isnull(string))
  222.     #else
  223.             if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  224.     #endif
  225.             {
  226.                     return format[0];
  227.             }
  228.     #pragma tabsize 4
  229.     new
  230.             formatPos = 0,
  231.             stringPos = 0,
  232.             paramPos = 2,
  233.             paramCount = numargs(),
  234.             delim = ' ';
  235.     while (string[stringPos] && string[stringPos] <= ' ')
  236.     {
  237.             stringPos++;
  238.     }
  239.     while (paramPos < paramCount && string[stringPos])
  240.     {
  241.             switch (format[formatPos++])
  242.             {
  243.                     case '\0':
  244.                     {
  245.                             return 0;
  246.                     }
  247.                     case 'i', 'd':
  248.                     {
  249.                             new
  250.                                     neg = 1,
  251.                                     num = 0,
  252.                                     ch = string[stringPos];
  253.                             if (ch == '-')
  254.                             {
  255.                                     neg = -1;
  256.                                     ch = string[++stringPos];
  257.                             }
  258.                             do
  259.                             {
  260.                                     stringPos++;
  261.                                     if ('0' <= ch <= '9')
  262.                                     {
  263.                                             num = (num * 10) + (ch - '0');
  264.                                     }
  265.                                     else
  266.                                     {
  267.                                             return -1;
  268.                                     }
  269.                             }
  270.                             while ((ch = string[stringPos]) > ' ' && ch != delim);
  271.                             setarg(paramPos, 0, num * neg);
  272.                     }
  273.                     case 'h', 'x':
  274.                     {
  275.                             new
  276.                                     num = 0,
  277.                                     ch = string[stringPos];
  278.                             do
  279.                             {
  280.                                     stringPos++;
  281.                                     switch (ch)
  282.                                     {
  283.                                             case 'x', 'X':
  284.                                             {
  285.                                                     num = 0;
  286.                                                     continue;
  287.                                             }
  288.                                             case '0' .. '9':
  289.                                             {
  290.                                                     num = (num << 4) | (ch - '0');
  291.                                             }
  292.                                             case 'a' .. 'f':
  293.                                             {
  294.                                                     num = (num << 4) | (ch - ('a' - 10));
  295.                                             }
  296.                                             case 'A' .. 'F':
  297.                                             {
  298.                                                     num = (num << 4) | (ch - ('A' - 10));
  299.                                             }
  300.                                             default:
  301.                                             {
  302.                                                     return -1;
  303.                                             }
  304.                                     }
  305.                             }
  306.                             while ((ch = string[stringPos]) > ' ' && ch != delim);
  307.                             setarg(paramPos, 0, num);
  308.                     }
  309.                     case 'c':
  310.                     {
  311.                             setarg(paramPos, 0, string[stringPos++]);
  312.                     }
  313.                     case 'f':
  314.                     {
  315.  
  316.                             new changestr[16], changepos = 0, strpos = stringPos;
  317.                             while(changepos < 16 && string[strpos] && string[strpos] != delim)
  318.                             {
  319.                                     changestr[changepos++] = string[strpos++];
  320.                             }
  321.                             changestr[changepos] = '\0';
  322.                             setarg(paramPos,0,_:floatstr(changestr));
  323.                     }
  324.                     case 'p':
  325.                     {
  326.                             delim = format[formatPos++];
  327.                             continue;
  328.                     }
  329.                     case '\'':
  330.                     {
  331.                             new
  332.                                     end = formatPos - 1,
  333.                                     ch;
  334.                             while ((ch = format[++end]) && ch != '\'') {}
  335.                             if (!ch)
  336.                             {
  337.                                     return -1;
  338.                             }
  339.                             format[end] = '\0';
  340.                             if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  341.                             {
  342.                                     if (format[end + 1])
  343.                                     {
  344.                                             return -1;
  345.                                     }
  346.                                     return 0;
  347.                             }
  348.                             format[end] = '\'';
  349.                             stringPos = ch + (end - formatPos);
  350.                             formatPos = end + 1;
  351.                     }
  352.                     case 'u':
  353.                     {
  354.                             new
  355.                                     end = stringPos - 1,
  356.                                     id = 0,
  357.                                     bool:num = true,
  358.                                     ch;
  359.                             while ((ch = string[++end]) && ch != delim)
  360.                             {
  361.                                     if (num)
  362.                                     {
  363.                                             if ('0' <= ch <= '9')
  364.                                             {
  365.                                                     id = (id * 10) + (ch - '0');
  366.                                             }
  367.                                             else
  368.                                             {
  369.                                                     num = false;
  370.                                             }
  371.                                     }
  372.                             }
  373.                             if (num && IsPlayerConnected(id))
  374.                             {
  375.                                     setarg(paramPos, 0, id);
  376.                             }
  377.                             else
  378.                             {
  379.                                     #if !defined foreach
  380.                                             #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  381.                                             #define __SSCANF_FOREACH__
  382.                                     #endif
  383.                                     string[end] = '\0';
  384.                                     num = false;
  385.                                     new
  386.                                             name[MAX_PLAYER_NAME];
  387.                                     id = end - stringPos;
  388.                                     foreach (Player, playerid)
  389.                                     {
  390.                                             GetPlayerName(playerid, name, sizeof (name));
  391.                                             if (!strcmp(name, string[stringPos], true, id))
  392.                                             {
  393.                                                     setarg(paramPos, 0, playerid);
  394.                                                     num = true;
  395.                                                     break;
  396.                                             }
  397.                                     }
  398.                                     if (!num)
  399.                                     {
  400.                                             setarg(paramPos, 0, INVALID_PLAYER_ID);
  401.                                     }
  402.                                     string[end] = ch;
  403.                                     #if defined __SSCANF_FOREACH__
  404.                                             #undef foreach
  405.                                             #undef __SSCANF_FOREACH__
  406.                                     #endif
  407.                             }
  408.                             stringPos = end;
  409.                     }
  410.                     case 's', 'z':
  411.                     {
  412.                             new
  413.                                     i = 0,
  414.                                     ch;
  415.                             if (format[formatPos])
  416.                             {
  417.                                     while ((ch = string[stringPos++]) && ch != delim)
  418.                                     {
  419.                                             setarg(paramPos, i++, ch);
  420.                                     }
  421.                                     if (!i)
  422.                                     {
  423.                                             return -1;
  424.                                     }
  425.                             }
  426.                             else
  427.                             {
  428.                                     while ((ch = string[stringPos++]))
  429.                                     {
  430.                                             setarg(paramPos, i++, ch);
  431.                                     }
  432.                             }
  433.                             stringPos--;
  434.                             setarg(paramPos, i, '\0');
  435.                     }
  436.                     default:
  437.                     {
  438.                             continue;
  439.                     }
  440.             }
  441.             while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  442.             {
  443.                     stringPos++;
  444.             }
  445.             while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  446.             {
  447.                     stringPos++;
  448.             }
  449.             paramPos++;
  450.     }
  451.     do
  452.     {
  453.             if ((delim = format[formatPos++]) > ' ')
  454.             {
  455.                     if (delim == '\'')
  456.                     {
  457.                             while ((delim = format[formatPos++]) && delim != '\'') {}
  458.                     }
  459.                     else if (delim != 'z')
  460.                     {
  461.                             return delim;
  462.                     }
  463.             }
  464.     }
  465.     while (delim > ' ');
  466.     return 0;
  467. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement