Problem mit Ticketsystem

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
  • Ich wollte ein neues Supportsystem von Steffen P. einfügen. Leider habe ich aber festgestellt, dass dort einige Abfragen bzw. Klammern nicht passen oder passend sind. Kann da jemand mal für mich drüber schauen und mir den neuen Code hier rein posten? Wäre super lieb von euch :)


    Kleine Info: Habe kein Dini sondern zcmd.


    /* Support System by Steffen P. aka Scriptor.*/

    #include <dini>
    #include <ocmd>

    //----------------------------------------------------------------

    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_GREY 0xAFAFAFAA

    //---------------------------------------------------------------

    new TicketZeile[MAX_PLAYERS];
    new SupportTicket[MAX_PLAYERS];
    new TicketAngenommen[MAX_PLAYERS];
    new DeinSupport[MAX_PLAYERS];

    //--------------------------------------------------------------

    //public OnPlayerConnect(playerid)

    TicketZeile[playerid] = 0;
    SupportTicket[playerid] = 0;
    TicketAngenommen[playerid] = 0;
    DeinSupport[playerid] = 0;

    //-------------------------------------------------------------

    ocmd:tickets(playerid, params[])
    {
    #pragma unused params
    if(pInfo[playerid][admin] >= 1)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "Die angezeigten Tickets können mit /taketicket angenommen werden");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(SupportTicket[i] == 1)
    {
    if(TicketAngenommen[i] == 0)
    {
    new string[128], DerSpieler[MAX_PLAYER_NAME];
    GetPlayerName(i, DerSpieler, sizeof(DerSpieler));
    format(string, sizeof(string), "ID: %d Name: %s", i, DerSpieler);
    SendClientMessage(playerid, COLOR_GREY, string);

    }
    }
    }
    }
    return 1;
    }

    ocmd:sup(playerid,params[])
    {
    new text[256];
    if(sscanf(params,"s",text))
    {
    SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /sup [text]");
    }
    else
    {
    if(TicketAngenommen[playerid] == 0)
    {
    new pname[MAX_PLAYERS],save[512], string[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(!dini_Exists(save) && TicketZeile[playerid] == 0)
    {
    new adminmeldung[128];
    format(adminmeldung, sizeof(adminmeldung), "%s hat ein Support-Ticket geschrieben", pname);
    SendAdminMessage(COLOR_YELLOW, adminmeldung);
    SupportTicket[playerid] = 1;
    TicketZeile[playerid] = 1;
    dini_Create(save);
    dini_Set(save,"Suptext",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast ein Ticket mit folgendem Text geöffnet:");
    format(string, sizeof(string), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT]Warte bis es ein Supporter annimmt!");
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT]Du kannst noch mit /sup 2 weitere Zeilen anhängen");
    return 1;
    }
    else if(TicketZeile[playerid] == 1)
    {
    new string2[128];
    dini_Set(save, "Suptext2",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
    format(string2, sizeof(string2), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string2);
    TicketZeile[playerid] = 2;
    return 1;
    }
    else if(TicketZeile[playerid] == 2)
    {
    new string3[128];
    dini_Set(save, "Suptext3",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
    format(string3, sizeof(string3), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string3);
    TicketZeile[playerid] = 3;
    return 1;
    }
    else if(TicketZeile[playerid] == 3)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Dein Ticket ist bereits randgefüllt!");
    return 1;
    }
    }
    if(TicketAngenommen[playerid] == 1)
    {
    new pID = DeinSupport[playerid];
    new antwort[128], antwort2[128], DerFragende[MAX_PLAYER_NAME], DerSup[MAX_PLAYER_NAME];
    GetPlayerName(playerid, DerFragende, sizeof (DerFragende));
    GetPlayerName(pID, DerSup, sizeof (DerSup));
    format(antwort, sizeof (antwort),"--> %s", text);
    SendClientMessage(playerid, COLOR_YELLOW, antwort);
    format(antwort2, sizeof (antwort2), "%s schrieb: %s", DerFragende, text);
    SendClientMessage(pID, COLOR_YELLOW, antwort2);
    }

    }
    return 1;
    }

    ocmd:giveticket(playerid, params[])
    {
    new pID, adminid;
    if(sscanf(params,"uu",pID,adminid)){
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /giveticket [ticketid] [adminid]");
    }
    if(!IsPlayerConnected(adminid))
    {
    return SendClientMessage(playerid, COLOR_GREY,"Admin nicht online");
    }
    if(pInfo[adminid][admin] == 0)
    {
    return SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist kein Admin");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(!dini_Exists(save))
    {
    return SendClientMessage(playerid, COLOR_GREY,"Die ID hat kein offenes Ticket");
    }
    new NeuerAdmin[MAX_PLAYER_NAME], AlterAdmin[MAX_PLAYER_NAME], Fragender[MAX_PLAYER_NAME];
    GetPlayerName(playerid, AlterAdmin , sizeof(AlterAdmin));
    GetPlayerName(adminid, NeuerAdmin, sizeof(NeuerAdmin));
    GetPlayerName(pID, Fragender , sizeof(Fragender));
    DeinSupport[pID] = adminid;
    new string2[128], string3[128], string4[256], string5[256], string6[256];
    format(string2, sizeof(string2), "[SUPPORT] %s hat dein Ticket an %s weitergegeben.", AlterAdmin, NeuerAdmin);
    SendClientMessage(pID, COLOR_YELLOW, string2);
    SendClientMessage(playerid, COLOR_YELLOW, "Erfolgreich weitergeleitet");
    format(string3, sizeof(string3), "[SUPPORT] %s hat dir %s´s Ticket gegeben. Er schrieb folgendes:", AlterAdmin, Fragender);
    string4 = dini_Get(save, "Suptext");
    string5 = dini_Get(save, "Suptext2");
    string6 = dini_Get(save, "Suptext3");
    SendClientMessage(adminid, COLOR_YELLOW, string3);
    SendClientMessage(adminid, COLOR_YELLOW, string4);
    SendClientMessage(adminid, COLOR_YELLOW, string5);
    SendClientMessage(adminid, COLOR_YELLOW, string6);
    return 1;
    }

    ocmd:deleteticket(playerid, params[])
    {
    new pID;
    if(sscanf(params,"u",pID)){
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /deleteticket [id]");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(dini_Exists(save))
    {
    if(pInfo[playerid][admin] >= 1)
    {
    new string[128], DerSup[MAX_PLAYER_NAME];
    GetPlayerName(playerid, DerSup, sizeof(DerSup));
    dini_Remove(save);
    format(string, sizeof(string), "%s hat dein Ticket gelöscht", DerSup);
    SendClientMessage(pID, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, "Erfolgreich gelöscht");
    TicketZeile[pID] = 0;
    TicketAngenommen[pID] = 0;
    DeinSupport[pID] = 0;
    SupportTicket[pID] = 0;
    }
    }
    return 1;
    }

    ocmd:taketicket(playerid,params[])
    {
    new pID;
    new string2[256], string[256], string3[256], string4[256],mitteilung[128] , DerPlayer[MAX_PLAYER_NAME], DerAdmin[MAX_PLAYER_NAME];
    if(sscanf(params,"u",pID)){
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /taketicket [id]");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(dini_Exists(save))
    {
    if(pInfo[playerid][admin] >= 1)
    {
    string2 = dini_Get(save,"Suptext");
    string3 = dini_Get(save,"Suptext2");
    string4 = dini_Get(save,"Suptext3");
    GetPlayerName(pID, DerPlayer, sizeof(DerPlayer));
    GetPlayerName(playerid, DerAdmin, sizeof(DerAdmin));
    format(string, sizeof(string), "%s schrieb folgende Supportnachricht:", DerPlayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, string2);
    SendClientMessage(playerid, COLOR_YELLOW, string3);
    SendClientMessage(playerid, COLOR_YELLOW, string4);
    SendClientMessage(playerid, COLOR_YELLOW, "Du kannst per /aw [ID] antworten");
    format(mitteilung, sizeof(mitteilung), "[SUPPORT] %s hat dein Support Ticket geöffnet. Du kannst nun per /sup direkt mit ihm schreiben!",DerAdmin);
    // new string5[128];
    // format(string5, sizeof (string5), "[SUPPORT] %s hat das Ticket von %s geöffnet");
    //SendAdminMessage(COLOR_YELLOW, string5);
    SendClientMessage(pID, COLOR_YELLOW, mitteilung);
    DeinSupport[pID] = playerid;
    TicketAngenommen[pID] = 1;
    }
    }
    return 1;
    }


    //---------------------------------------------------------------------------------

    stock DeleteTicket(playerid)
    {
    new save1[256], pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    format(save1,sizeof save1,"Tickets/%s.ini",pname);
    if(fexist(save1))
    {
    dini_Remove(save1);
    }
    return true;
    }

    //-----------------------------------------------------------------------------------------

    //OnPlayerDisconnect

    DeleteTicket(playerid);

    Einmal editiert, zuletzt von Akaya ()

  • Spoiler anzeigen
    /* Support System by Steffen P. aka Scriptor.*/

    Spoiler anzeigen
    #include <dini>
    #include <ocmd>

    Spoiler anzeigen
    //----------------------------------------------------------------

    Spoiler anzeigen
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_GREY 0xAFAFAFAA

    Spoiler anzeigen
    //---------------------------------------------------------------

    Spoiler anzeigen
    new TicketZeile[MAX_PLAYERS];
    new SupportTicket[MAX_PLAYERS];
    new TicketAngenommen[MAX_PLAYERS];
    new DeinSupport[MAX_PLAYERS];

    Spoiler anzeigen
    //--------------------------------------------------------------

    Spoiler anzeigen
    //public OnPlayerConnect(playerid)

    Spoiler anzeigen
    TicketZeile[playerid] = 0;
    SupportTicket[playerid] = 0;
    TicketAngenommen[playerid] = 0;
    DeinSupport[playerid] = 0;

    Spoiler anzeigen
    //-------------------------------------------------------------

    Spoiler anzeigen
    ocmd:tickets(playerid, params[])
    {
    #pragma unused params
    if(pInfo[playerid][admin] >= 1)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "Die angezeigten Tickets können mit /taketicket angenommen werden");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(SupportTicket[i] == 1)
    {
    if(TicketAngenommen[i] == 0)
    {
    new string[128], DerSpieler[MAX_PLAYER_NAME];
    GetPlayerName(i, DerSpieler, sizeof(DerSpieler));
    format(string, sizeof(string), "ID: %d Name: %s", i, DerSpieler);
    SendClientMessage(playerid, COLOR_GREY, string);

    }
    }
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:sup(playerid,params[])
    {
    new text[256];
    if(sscanf(params,"s",text))
    {
    SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /sup [text]");
    }
    else
    {
    if(TicketAngenommen[playerid] == 0)
    {
    new pname[MAX_PLAYERS],save[512], string[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(!dini_Exists(save) && TicketZeile[playerid] == 0)
    {
    new adminmeldung[128];
    format(adminmeldung, sizeof(adminmeldung), "%s hat ein Support-Ticket geschrieben", pname);
    SendAdminMessage(COLOR_YELLOW, adminmeldung);
    SupportTicket[playerid] = 1;
    TicketZeile[playerid] = 1;
    dini_Create(save);
    dini_Set(save,"Suptext",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast ein Ticket mit folgendem Text geöffnet:");
    format(string, sizeof(string), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT]Warte bis es ein Supporter annimmt!");
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT]Du kannst noch mit /sup 2 weitere Zeilen anhängen");
    return 1;
    }
    else if(TicketZeile[playerid] == 1)
    {
    new string2[128];
    dini_Set(save, "Suptext2",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
    format(string2, sizeof(string2), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string2);
    TicketZeile[playerid] = 2;
    return 1;
    }
    else if(TicketZeile[playerid] == 2)
    {
    new string3[128];
    dini_Set(save, "Suptext3",text);
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
    format(string3, sizeof(string3), "%s", text);
    SendClientMessage(playerid, COLOR_YELLOW, string3);
    TicketZeile[playerid] = 3;
    return 1;
    }
    else if(TicketZeile[playerid] == 3)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "[SUPPORT] Dein Ticket ist bereits randgefüllt!");
    return 1;
    }
    }
    if(TicketAngenommen[playerid] == 1)
    {
    new pID = DeinSupport[playerid];
    new antwort[128], antwort2[128], DerFragende[MAX_PLAYER_NAME], DerSup[MAX_PLAYER_NAME];
    GetPlayerName(playerid, DerFragende, sizeof (DerFragende));
    GetPlayerName(pID, DerSup, sizeof (DerSup));
    format(antwort, sizeof (antwort),"--> %s", text);
    SendClientMessage(playerid, COLOR_YELLOW, antwort);
    format(antwort2, sizeof (antwort2), "%s schrieb: %s", DerFragende, text);
    SendClientMessage(pID, COLOR_YELLOW, antwort2);
    }

    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:giveticket(playerid, params[])
    {
    new pID, adminid;
    if(sscanf(params,"uu",pID,adminid))
    {
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /giveticket [ticketid] [adminid]");
    }
    if(!IsPlayerConnected(adminid))
    {
    return SendClientMessage(playerid, COLOR_GREY,"Admin nicht online");
    }
    if(pInfo[adminid][admin] == 0)
    {
    return SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist kein Admin");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(!dini_Exists(save))
    {
    return SendClientMessage(playerid, COLOR_GREY,"Die ID hat kein offenes Ticket");
    }
    new NeuerAdmin[MAX_PLAYER_NAME], AlterAdmin[MAX_PLAYER_NAME], Fragender[MAX_PLAYER_NAME];
    GetPlayerName(playerid, AlterAdmin , sizeof(AlterAdmin));
    GetPlayerName(adminid, NeuerAdmin, sizeof(NeuerAdmin));
    GetPlayerName(pID, Fragender , sizeof(Fragender));
    DeinSupport[pID] = adminid;
    new string2[128], string3[128], string4[256], string5[256], string6[256];
    format(string2, sizeof(string2), "[SUPPORT] %s hat dein Ticket an %s weitergegeben.", AlterAdmin, NeuerAdmin);
    SendClientMessage(pID, COLOR_YELLOW, string2);
    SendClientMessage(playerid, COLOR_YELLOW, "Erfolgreich weitergeleitet");
    format(string3, sizeof(string3), "[SUPPORT] %s hat dir %s´s Ticket gegeben. Er schrieb folgendes:", AlterAdmin, Fragender);
    string4 = dini_Get(save, "Suptext");
    string5 = dini_Get(save, "Suptext2");
    string6 = dini_Get(save, "Suptext3");
    SendClientMessage(adminid, COLOR_YELLOW, string3);
    SendClientMessage(adminid, COLOR_YELLOW, string4);
    SendClientMessage(adminid, COLOR_YELLOW, string5);
    SendClientMessage(adminid, COLOR_YELLOW, string6);
    return 1;
    }

    Spoiler anzeigen
    ocmd:deleteticket(playerid, params[])
    {
    new pID;
    if(sscanf(params,"u",pID))
    {
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /deleteticket [id]");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(dini_Exists(save))
    {
    if(pInfo[playerid][admin] >= 1)
    {
    new string[128], DerSup[MAX_PLAYER_NAME];
    GetPlayerName(playerid, DerSup, sizeof(DerSup));
    dini_Remove(save);
    format(string, sizeof(string), "%s hat dein Ticket gelöscht", DerSup);
    SendClientMessage(pID, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, "Erfolgreich gelöscht");
    TicketZeile[pID] = 0;
    TicketAngenommen[pID] = 0;
    DeinSupport[pID] = 0;
    SupportTicket[pID] = 0;
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:taketicket(playerid,params[])
    {
    new pID;
    new string2[256], string[256], string3[256], string4[256],mitteilung[128] , DerPlayer[MAX_PLAYER_NAME], DerAdmin[MAX_PLAYER_NAME];
    if(sscanf(params,"u",pID))
    {
    return SendClientMessage(playerid, COLOR_GREY,"[Benutzung]: /taketicket [id]");
    }
    new pname[MAX_PLAYERS],save[512];
    GetPlayerName(pID,pname,sizeof pname);
    format(save,sizeof save,"Tickets/%s.ini",pname);
    if(dini_Exists(save))
    {
    if(pInfo[playerid][admin] >= 1)
    {
    string2 = dini_Get(save,"Suptext");
    string3 = dini_Get(save,"Suptext2");
    string4 = dini_Get(save,"Suptext3");
    GetPlayerName(pID, DerPlayer, sizeof(DerPlayer));
    GetPlayerName(playerid, DerAdmin, sizeof(DerAdmin));
    format(string, sizeof(string), "%s schrieb folgende Supportnachricht:", DerPlayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, string2);
    SendClientMessage(playerid, COLOR_YELLOW, string3);
    SendClientMessage(playerid, COLOR_YELLOW, string4);
    SendClientMessage(playerid, COLOR_YELLOW, "Du kannst per /aw [ID] antworten");
    format(mitteilung, sizeof(mitteilung), "[SUPPORT] %s hat dein Support Ticket geöffnet. Du kannst nun per /sup direkt mit ihm schreiben!",DerAdmin);
    //new string5[128];
    //format(string5, sizeof (string5), "[SUPPORT] %s hat das Ticket von %s geöffnet");
    //SendAdminMessage(COLOR_YELLOW, string5);
    SendClientMessage(pID, COLOR_YELLOW, mitteilung);
    DeinSupport[pID] = playerid;
    TicketAngenommen[pID] = 1;
    }
    }
    return 1;
    }

    Spoiler anzeigen
    //---------------------------------------------------------------------------------

    Spoiler anzeigen
    stock DeleteTicket(playerid)
    {
    new save1[256], pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    format(save1,sizeof save1,"Tickets/%s.ini",pname);
    if(fexist(save1))
    {
    dini_Remove(save1);
    }
    return true;
    }

    Spoiler anzeigen
    //-----------------------------------------------------------------------------------------

    Spoiler anzeigen
    //OnPlayerDisconnect

    Spoiler anzeigen
    DeleteTicket(playerid);

    So wäre es richtig eingerückt.


    Was sind sonst für Probleme vorhanden? Erkläre das bitte jeweils einzeln.

  • Ich habe zcmd und nicht Dini. Ich kriege das nicht hin .__.


    #include <a_samp>
    #include <a_mysql>
    #include <a_http>
    #include <streamer>
    #include <md5>
    #include <zcmd>
    #include <sscanf2>


    Das sind meine Includes.