Support system tut nicht mit gl_chat

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo liebe breadfish Gemeinde ich habe mir ein Support System für Samp geschrieben ist auch alles OK es tut auch usw. ich habe es gemacht das man in ein Chat mit den Support kommt tut auch so seit heute habe ich ein schon vorgefertigtes Filterseite vom Samp Team genommen : gl_chat damit man dem Chat nur einige Meter sehen kann auch das hat getan aber als ich dann mein Support System genutzt habe bin ich normal in den Chat gejoint habe auch geschrieben aber meine Schrift kam einfach in normalen Chat und dabei blieb es auch der andere der mit mir im Chat wahr konnte ebenfalls nur im normalen Chat schreiben obwohl wir beide im Supchat wahren


    Ich hoffe das mir einer Helfen kann


    M.F.G
    Blaizerado

  • Bitte einmal das Sup system



    forward ReportPlayer(playerid, reportedid, reason[], description[]);
    new ID[50];


    public OnFilterScriptInit()
    {
    #if used == 1
    mysql_connect(mysql_host, mysql_name, mysql_pw, mysql_db);
    new query[256] = "CREATE TABLE [IF NOT EXISTS] `reports` (";
    strcat(query, "`id` INT NOT NULL AUTO_INCREMENT ,");
    strcat(query, "`reporter` VARCHAR( 24 ) NOT NULL ,");
    strcat(query, "`reported` VARCHAR( 24 ) NOT NULL ,");
    strcat(query, "`reason` VARCHAR( 24 ) NOT NULL ,");
    strcat(query, "`description` VARCHAR( 68 ) NOT NULL ,");
    strcat(query, "`time` VARCHAR( 24 ) NOT NULL ,");
    strcat(query, "`read` INT( 2 ) ,");
    strcat(query, "PRIMARY KEY ( `id` ))");
    mysql_query(query);
    #endif
    print("-Ø Dynamisches Report-System von Padarom Ø-");
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    if(GetPVarInt(playerid, "inChat") == 1)
    {
    new pName[24], msg[128];
    GetPlayerName(playerid, pName, 24);
    format(msg, 128, "[ %s: %s ]", pName, text);
    SendClientMessage(playerid, 0x2FABEDFF, msg);
    SendClientMessage(GetPVarInt(playerid,"ticketPartner"), 0x2FABEDFF, msg);
    return 0;
    }
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    SetPVarInt(playerid, "subject", -1);
    SetPVarString(playerid, "reportreason", "");
    SetPVarInt(playerid, "ticketPartner", -1);
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    if(GetPVarInt(playerid, "inChat") == 1)
    {
    SendClientMessage(GetPVarInt(playerid,"ticketPartner"), 0x2FABEDFF, "[ * Dein Ticketpartner ist offline gegangen. Das Ticket wurde beendet. ]");
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"inChat", 0);
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"ticketPartner", -1);
    }
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(!strcmp(cmdtext,"/Sup",false) || !strcmp(cmdtext,"/melden",false))
    {
    ShowPlayerDialog(playerid, dialog1, DIALOG_STYLE_LIST, "Beschwerde", "Hacken\nRegelverstoß\Beleidigung", "Weiter", "Abbrechen");
    return 1;
    }
    if(!strcmp(cmdtext,"/sehetickets",false) || !strcmp(cmdtext,"/tickets",false))
    {
    if(!IsPlayerAdmin(playerid) && GetPVarInt(playerid, pvar_name) < pvar_minlvl) return SendClientMessage(playerid, 0xEDB90CFF, "* Du hast keine Berechtigungen um diesen Command zu nutzen.");
    ShowTicketDialog(playerid);
    return 1;
    }
    if(!strcmp(cmdtext,"/tchat"))
    {
    if(GetPVarInt(playerid,"ticketPartner") != -1 && GetPVarInt(playerid,"inChat") == 0)
    {
    SetPVarInt(playerid,"inChat",1);
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"inChat",1);
    SendClientMessage(playerid, 0xEDB90CFF, "* Du hast den Ticketchat angenommen. Du kannst nun mit dem Admin reden.");
    SendClientMessage(GetPVarInt(playerid,"ticketPartner"), 0xEDB90CFF, "* Dein Ticketchat wurde gestartet. Du kannst nun mit dem Verfasser des Tickets reden.");
    }
    else if(GetPVarInt(playerid,"inChat") == 1)
    {
    SendClientMessage(playerid, 0xEDB90CFF, "* Du hast den Ticketchat beendet.");
    SendClientMessage(GetPVarInt(playerid,"ticketPartner"), 0xEDB90CFF, "* Dein aktiver Ticketchat wurde beendet.");
    SetPVarInt(playerid,"inChat",0);
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"inChat",0);
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"ticketPartner",-1);
    SetPVarInt(playerid,"ticketPartner",-1);
    }
    else SendClientMessage(playerid, 0xEDB90CFF, "* Du hast aktuell keinen Ticketchat am Laufen.");
    return 1;
    }
    return 0;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == dialog1 && response)
    {
    switch(listitem)
    {
    case 0: SetPVarString(playerid, "reason", "Hacken");
    case 1: SetPVarString(playerid, "reason", "Regelverstoß");
    case 2: SetPVarString(playerid, "reason", "Beleidigung");
    }
    if(GetPVarInt(playerid, "subject") == -1) ShowPlayerDialog(playerid, dialog2, DIALOG_STYLE_INPUT, "Beschwerde - Seite 2", "Bitte gib nun den Namen oder die ID des zu meldenden Spielers an.", "Weiter", "Zurück");
    else ShowPlayerDialog(playerid, dialog3, DIALOG_STYLE_INPUT, "Beschwerde - Seite 3", "Bitte gib nun eine kurze Beschreibung zu deiner Beschwerde an.", "Weiter", "Zurück");
    }
    else if(dialogid == dialog2)
    {
    if(response)
    {
    new sName[24];
    if(!IsNumeric(inputtext))
    {
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    GetPlayerName(i, sName, 24);
    if(!strcmp(inputtext, sName, true))
    {
    SetPVarInt(playerid, "subject", i);
    break;
    }
    }
    }
    if(GetPVarInt(playerid,"subject") == -1) return ShowPlayerDialog(playerid, dialog2, DIALOG_STYLE_INPUT, "Beschwerde - Seite 2", "Bitte gib nun den Namen oder die ID des zu meldenden Spielers an.", "Weiter", "Zurück");
    }
    else
    {
    if(!IsPlayerConnected(strval(inputtext)) || !strlen(inputtext)) return ShowPlayerDialog(playerid, dialog2, DIALOG_STYLE_INPUT, "Beschwerde - Seite 2", "Bitte gib nun den Namen oder die ID des zu meldenden Spielers an.", "Weiter", "Zurück");
    else SetPVarInt(playerid, "subject", strval(inputtext));
    }
    ShowPlayerDialog(playerid, dialog3, DIALOG_STYLE_INPUT, "Beschwerde - Seite 3", "Bitte gib nun eine kurze Beschreibung zu deiner Beschwerde an.", "Weiter", "Zurück");
    }
    else return ShowPlayerDialog(playerid, dialog1, DIALOG_STYLE_LIST, "Beschwerde", "Hacken\nVerstoß gegen die Regeln\nBeleidigung\nAbwerben\nSpam\nIch möchte nur die Admins nerven", "Weiter", "Abbrechen");
    }
    else if(dialogid == dialog3)
    {
    if(response)
    {
    if(!strlen(inputtext)) return ShowPlayerDialog(playerid, dialog3, DIALOG_STYLE_INPUT, "Beschwerde - Seite 3", "Bitte gib nun eine kurze Beschreibung zu deiner Beschwerde an.", "Weiter", "Zurück");
    else
    {
    new text[256], sName[24], reason[24], description[128];
    SetPVarString(playerid, "description", inputtext);
    GetPlayerName(GetPVarInt(playerid, "subject"), sName, 24);
    GetPVarString(playerid, "reason", reason, 24);
    GetPVarString(playerid, "description", description, 128);
    format(text, 256, "{ED9E15}Spieler: {FFFFFF}%s (ID: %i)\n{ED9E15}Grund: {FFFFFF}%s\n{ED9E15}Beschreibung: {FFFFFF}%s\n\nWenn diese Beschwerde korrekt ist, klicke bitte auf Absenden. Ansonsten auf Abbrechen.", sName, GetPVarInt(playerid, "subject"), reason, description);
    ShowPlayerDialog(playerid, dialog4, DIALOG_STYLE_MSGBOX, "Beschwerde - Abschluss", text, "Absenden", "Abbrechen");
    }
    }
    else return ShowPlayerDialog(playerid, dialog2, DIALOG_STYLE_INPUT, "Beschwerde - Seite 2", "Bitte gib nun den Namen oder die ID des zu meldenden Spielers an.", "Weiter", "Zurück");
    }
    else if(dialogid == dialog4)
    {
    if(!response) return SetPVarInt(playerid, "subject", -1);
    new reason[24], description[64];
    GetPVarString(playerid, "reason", reason, 24);
    GetPVarString(playerid, "description", description, 64);
    ReportPlayer(playerid, GetPVarInt(playerid, "subject"), reason, description);
    SendClientMessage(playerid, 0xEDB90CFF, "* Deine Beschwerde wurde erfolgreich eingereicht.");
    SetPVarInt(playerid, "subject", -1);
    }
    else if(dialogid == dialog5)
    {
    if(!response) return 1;
    new autor[256], subject[256], description[256], reason[256], time[256];
    new path[68], text[500], string[128];
    #if used == 1
    #pragma unused string
    format(path, 68, "SELECT * FROM reports WHERE id = %i", ID[listitem]);
    mysql_query(path);
    mysql_store_result();
    mysql_fetch_field("reason", reason);
    mysql_fetch_field("time", time);
    mysql_fetch_field("subject", subject);
    mysql_fetch_field("description", description);
    mysql_fetch_field("reporter", autor);
    mysql_free_result();
    format(path, 68, "UPDATE reports SET read = 1 WHERE id = %i", ID[listitem]);
    mysql_query(path);
    #endif
    #if used == 2
    #pragma unused string
    format(path, 68, "/%s/%i.ini", dini_path, ID[listitem]);
    autor = dini_Get(path, "reporter");
    subject = dini_Get(path, "subject");
    description = dini_Get(path, "description");
    reason = dini_Get(path, "reason");
    time = dini_Get(path, "time");
    dini_IntSet(path, "read", 1);
    SetPVarInt(playerid,"sTicket",ID[listitem]);
    #endif
    #if used == 3
    format(path, 68, "/%s/%i.txt", dini_path, ID[listitem]);
    new File:report = fopen(path, io_read);
    while(fread(report, string))
    {
    string[strlen(string)-1] = '\0';
    if(strfind(string, "subject", true) != -1) { strdel(string, 0, 8); subject = string; }
    if(strfind(string, "time", true) != -1) { strdel(string, 0, 5); time = string; }
    if(strfind(string, "reason", true) != -1) { strdel(string, 0, 7); reason = string; }
    if(strfind(string, "description", true) != -1) { strdel(string, 0, 12); description = string; }
    if(strfind(string, "reporter", true) != -1) { strdel(string, 0, 9); autor = string; }
    }
    fclose(report);
    fremove(path);
    report = fopen(path, io_readwrite);
    format(text, 256, "reporter=%s\r\nsubject=%s\r\nreason=%s\r\ndescription=%s\r\ntime=%s\r\nread=1", autor, subject, reason, description, time);
    fwrite(report, text);
    fclose(report);
    SetPVarInt(playerid,"sTicket",ID[listitem]);
    #endif
    new bool:online, pName[24];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    GetPlayerName(i, pName, 24);
    if(!strcmp(pName, autor, true, strlen(pName)))
    {
    online = true;
    SetPVarInt(playerid,"ticketReady",1);
    SetPVarInt(playerid,"ticketPartner",i);
    break;
    }
    }
    }
    if(online == true) format(text, 500, "{ED9E15}Beschwerde verfasst (am %s Uhr) von {FFFFFF}%s\n{ED9E15}Spieler: {FFFFFF}%s\n{ED9E15}Grund: {FFFFFF}%s\n{ED9E15}Beschreibung: {FFFFFF}%s\n\nDer Autor des Tickets ist aktuell online. Um dich mit ihm zu unterhalten, klicke auf den rechten Button.", time, autor, subject, reason, description);
    else format(text, 500, "{ED9E15}Beschwerde verfasst (am %s Uhr) von {FFFFFF}%s\n{ED9E15}Spieler: {FFFFFF}%s\n{ED9E15}Grund: {FFFFFF}%s\n{ED9E15}Beschreibung: {FFFFFF}%s\n\nDer Autor des Tickets ist aktuell offline. Wenn du dich mit ihm unterhalten willst, musst du dich noch ein bisschen gedulden.", time, autor, subject, reason, description);
    if(online == true) ShowPlayerDialog(playerid, dialog6, DIALOG_STYLE_MSGBOX, "Beschwerde", text, "Zurück", "Chat");
    else ShowPlayerDialog(playerid, dialog6, DIALOG_STYLE_MSGBOX, "Beschwerde", text, "Zurück", "Zurück");


    }
    else if(dialogid == dialog6)
    {
    if(!response && GetPVarInt(playerid,"ticketReady") == 0) { ShowTicketDialog(playerid); SetPVarInt(playerid,"sTicket",-1); }
    else if(!response && GetPVarInt(playerid,"ticketReady") == 1)
    {
    new msg[128], pName[24];
    SetPVarInt(GetPVarInt(playerid,"ticketPartner"),"ticketPartner",playerid);
    SetPVarInt(playerid, "ticketReady", 0);
    GetPlayerName(playerid, pName, 24);
    format(msg, 128, "* Der Admin %s möchte gerne bezüglich deiner Beschwerde mit dir sprechen. Tippe /tchat, sobald du Zeit hast.", pName);
    SendClientMessage(GetPVarInt(playerid,"ticketPartner"), 0xEDB90CFF, msg);
    GetPlayerName(GetPVarInt(playerid,"ticketPartner"), pName, 24);
    format(msg, 128, "* Eine Ticketchat-Anfrage wurde an %s verschickt. Bitte warte, bis er sie akzeptiert.", pName);
    SendClientMessage(playerid, 0xEDB90CFF, msg);
    }
    else if(response)
    {
    SetPVarInt(playerid, "ticketPartner", 0);
    SetPVarInt(playerid, "ticketReady", 0);
    ShowPlayerDialog(playerid, dialog7, DIALOG_STYLE_MSGBOX, "Löschen der Beschwerde", "Du hast die Beschwerde nun eingesehen.\nWillst du sie löschen?", "Ja", "Nein");
    }
    }
    else if(dialogid == dialog7)
    {
    if(response)
    {
    new path[68];
    #if used == 1
    format(path, 68, "DELETE FROM reports WHERE id = %i", GetPVarInt(playerid,"sTicket"));
    mysql_query(path);
    #endif
    #if used == 2
    format(path, 68, "/%s/%i.ini", dini_path, GetPVarInt(playerid,"sTicket"));
    dini_Remove(path);
    #endif
    #if used == 3
    format(path, 68, "/%s/%i.txt", dini_path, GetPVarInt(playerid,"sTicket"));
    fremove(path);
    #endif
    ShowTicketDialog(playerid);
    SendClientMessage(playerid, 0xEDB90CFF, "* Das Ticket wurde erfolgreich gelöscht.");
    SetPVarInt(playerid, "sTicket", 0);
    }
    else ShowTicketDialog(playerid);
    }
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid)
    {
    #if defined click_used
    SetPVarInt(playerid, "subject", clickedplayerid);
    ShowPlayerDialog(playerid, dialog1, DIALOG_STYLE_LIST, "Beschwerde - Seite 1", "Hacken\nVerstoß gegen die Regeln\nBeleidigung\nAbwerben\nSpam\nIch möchte nur die Admins nerven", "Weiter", "Abbrechen");
    #endif
    return 1;
    }


    ShowTicketDialog(playerid)
    {
    new i=0, count=0, path[68], msg[1028] = "", cat[128], bool:exists;
    new reason[256], date[256], subject[256], read[256], string[82];
    #if used == 1
    #pragma unused string
    do
    {
    i++;
    format(path, 68, "SELECT * FROM reports WHERE id = %i", i);
    mysql_query(path);
    mysql_store_result();
    if(mysql_num_rows())
    {
    ID[count] = i;
    count++;
    exists = true;
    mysql_fetch_field("reason", reason);
    mysql_fetch_field("time", date);
    mysql_fetch_field("subject", subject);
    mysql_fetch_field("read", read);
    if(strval(read)) format(cat, 68, "{ED9E15}%s {FFFFFF}%s: %s\n", date, subject, reason);
    else format(cat, 68,"{ED9E15}%s {ED1515}%s: %s\n", date, subject, reason);
    strcat(msg, cat);
    mysql_free_result();
    }
    else mysql_free_result();
    }
    while(i<50);
    if(!exists) return ShowPlayerDialog(playerid, dialog8, DIALOG_STYLE_MSGBOX, "Beschwerden", "Es sind aktuell keine Beschwerden eingetragen.", "Okay", "Nicht okay");
    ShowPlayerDialog(playerid, dialog5, DIALOG_STYLE_LIST, "Beschwerden", msg, "Auswählen", "Abbrechen");
    #endif
    #if used == 2
    #pragma unused string
    do
    {
    i++;
    format(path, 68, "/%s/%i.ini", dini_path, i);
    if(dini_Exists(path))
    {
    ID[count] = i;
    count++;
    exists = true;
    reason = dini_Get(path, "reason");
    date = dini_Get(path, "time");
    subject = dini_Get(path, "subject");
    read = dini_Get(path, "read");
    if(strval(read)) format(cat, 68, "{ED9E15}%s {FFFFFF}%s: %s\n", date, subject, reason);
    else format(cat, 68,"{ED9E15}%s {ED1515}%s: %s\n", date, subject, reason);
    strcat(msg, cat);
    }
    }
    while(i<50);
    if(!exists) return ShowPlayerDialog(playerid, dialog8, DIALOG_STYLE_MSGBOX, "Beschwerden", "Es sind aktuell keine Beschwerden eingetragen.", "Okay", "Nicht okay");
    ShowPlayerDialog(playerid, dialog5, DIALOG_STYLE_LIST, "Beschwerden", msg, "Auswählen", "Abbrechen");
    #endif
    #if used == 3
    do
    {
    i++;
    format(path, 68, "/%s/%i.txt", dini_path, i);
    if(fexist(path))
    {
    ID[count] = i;
    count++;
    exists = true;
    new File:report = fopen(path, io_read);
    while(fread(report, string))
    {
    if(strfind(string, "subject", true) != -1) { string[strlen(string)-1] = '\0'; strdel(string, 0, 8); subject = string; }
    if(strfind(string, "time", true) != -1) { string[strlen(string)-1] = '\0'; strdel(string, 0, 5);date = string; }
    if(strfind(string, "reason", true) != -1) { string[strlen(string)-1] = '\0'; strdel(string, 0, 7); reason = string; }
    if(strfind(string, "read", true) != -1) { strdel(string, 0, 5); read = string; }
    }
    if(strval(read)) format(cat, 68, "{ED9E15}%s {FFFFFF}%s: %s\n", date, subject, reason);
    else format(cat, 68,"{ED9E15}%s {ED1515}%s: %s\n", date, subject, reason);
    strcat(msg, cat);
    fclose(report);
    }
    }
    while(i<50);
    if(!exists) return ShowPlayerDialog(playerid, dialog8, DIALOG_STYLE_MSGBOX, "Beschwerden", "Es sind aktuell keine Beschwerden eingetragen.", "Okay", "Nicht okay");
    ShowPlayerDialog(playerid, dialog5, DIALOG_STYLE_LIST, "Beschwerden", msg, "Auswählen", "Abbrechen");
    #endif
    return 1;
    }


    stock IsNumeric(const string[])
    {
    new length=strlen(string);
    if(length==0)
    {
    return 0;
    }
    for (new i=0; i<length; i++)
    {
    if (!((string[i] <= '9' && string[i] >= '0') || (i==0 && (string[i]=='-' || string[i]=='+'))))
    {
    return false;
    }
    }
    return 1;
    }


    public ReportPlayer(playerid, reportedid, reason[], description[])
    {
    new path[256], i=0, pName[24], sName[24], msg[128], date[24];
    GetPlayerName(playerid, pName, 24);
    GetPlayerName(reportedid, sName, 24);
    new y, m, d, h, minu;
    getdate(y, m, d);
    gettime(h, minu);
    format(date, 24, "%02i.%02i.%i %02i:%02i", d, m, y, h, minu);
    #if used == 1
    #pragma unused i
    mysql_real_escape_string(pName, pName);
    mysql_real_escape_string(sName, sName);
    mysql_real_escape_string(description, description);
    format(path, 128, "INSERT INTO reports (reporter, subject, reason, description, time) VALUES (%s, %s, %s, %s, %s)", pName, sName, reason, description, date);
    mysql_query(path);
    #endif
    #if used == 2
    do {
    i++;
    format(path, 68, "/%s/%i.ini", dini_path, i);
    }
    while(dini_Exists(path));
    dini_Create(path);
    dini_Set(path, "reporter", pName);
    dini_Set(path, "subject", sName);
    dini_Set(path, "reason", reason);
    dini_Set(path, "description", description);
    dini_Set(path, "time", date);
    #endif
    #if used == 3
    new text[256];
    do {
    i++;
    format(path, 68, "/%s/%i.txt", dini_path, i);
    }
    while(fexist(path));
    new File:report = fopen(path, io_readwrite);
    format(text, 256, "reporter=%s\r\nsubject=%s\r\nreason=%s\r\ndescription=%s\r\ntime=%s\r\nread=0", pName, sName, reason, description, date);
    fwrite(report, text);
    fclose(report);
    #endif
    #if defined admin_send
    for(new a=0; a<MAX_PLAYERS; a++)
    {
    if(IsPlayerConnected(a) && (IsPlayerAdmin(a) || GetPVarInt(a, pvar_name)>pvar_minlvl))
    {
    format(msg, 128, "* %s (ID: %i) hat %s (ID: %i) gemeldet. Nutze /tickets um das Ticket zu überprüfen.", pName, playerid, sName, reportedid);
    SendClientMessage(a, 0xEDB90CFF, msg);
    }
    }
    #endif
    return 1;
    }
    [/i][/i][/i][/i]

    2 Mal editiert, zuletzt von Blaizerado ()