Error mit Supportsystem

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
  • HeyHoo,


    Ich habe folgendes System gebastelt:

    Spoiler anzeigen

    //Color
    #define admwarn2 0xFF9F00FF
    #define adminticket 0xC30000FF
    #define admwarn 0xFFB500FF
    #define dr 0xAF0000FF

    Spoiler anzeigen
    //Arrays
    new SupDuty[MAX_PLAYERS];
    new TicketGeschrieben[MAX_PLAYERS];
    new InSupport[MAX_PLAYERS];
    new InSupportt[MAX_PLAYERS];
    new Supporter[MAX_PLAYERS];
    new DeinSupport[MAX_PLAYERS];

    Spoiler anzeigen
    //OnPlayerText
    public OnPlayerText(playerid, text[])
    {
    new string[128];
    if(realchat)
    {
    if(GetPVarInt(playerid,"Mute") == 0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s sagt: %s", sendername, text);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 0;
    }
    else if(GetPVarInt(playerid,"Mute") != 0)
    {
    SendClientMessage(playerid,Rot,"Du wurdest Gemutet!");
    return 0;
    }
    if(InSupport[playerid] != 0)
    {
    new adminlevel[56];
    if(GetPVarInt(playerid,"Adminlevel")==1)format(adminlevel,sizeof(adminlevel),"Supporter");
    else if(GetPVarInt(playerid,"Adminlevel")==3)format(adminlevel,sizeof(adminlevel),"Moderator");
    else if(GetPVarInt(playerid,"Adminlevel")==1335)format(adminlevel,sizeof(adminlevel),"Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1337)format(adminlevel,sizeof(adminlevel),"Lead-Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1338)format(adminlevel,sizeof(adminlevel),"Serverinhaber");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s(%s) sagt: %s", sendername, adminlevel, text);
    new Fragesteller = DeinSupport[playerid];
    SendClientMessage(playerid, dr, string);
    SendClientMessage(Fragesteller, dr, string);
    return 1;
    }
    else if(InSupportt[playerid] != 0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s sagt: %s", sendername, text);
    new Sup = DeinSupport[playerid];
    SendClientMessage(playerid, dr, string);
    SendClientMessage(Sup, dr, string);
    return 1;
    }
    }
    return 1;
    }

    Spoiler anzeigen
    //Befehle
    ocmd:supportduty(playerid,params[])
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    if(SupDuty[playerid] == 0)
    {
    new string[256];
    SupDuty[playerid] = 1;
    format(string,sizeof(string),"Meldung: %s hat sich als Supporter angemeldet! Du kannst ihn mit /support erreichen.",PlayerName(playerid));
    SendClientMessageToAll(admwarn2,string);
    return 1;
    }
    else if(SupDuty[playerid] == 1)
    {
    new string[256];
    SupDuty[playerid] = 0;
    format(string,sizeof(string),"Meldung: %s hat sich als Supporter abgemeldet!",PlayerName(playerid));
    SendClientMessageToAll(admwarn2,string);
    return 1;
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:support(playerid,params[])
    {
    new Text[128];
    if(sscanf(params,"s",Text))return SendClientMessage(playerid,Grau,"Benutze: /support [Text]");
    {
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(SupDuty[i] == 1)
    {
    new string[256];
    format(string,sizeof(string),"[SUPPORT] %s(ID: %d) hat folgendes Supportticket eingereicht: %s !",PlayerName(playerid),playerid,Text);
    SendClientMessage(i,dr,string);
    TicketGeschrieben[playerid] = 1;
    new Support[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Support,sizeof(Support),"/Supports/Support_%s.ini",name);
    dini_Create(Support);
    dini_Set(Support,"Name",name);
    dini_Set(Support,"Text",Text);
    SendClientMessage(playerid,Orange,"Du hast dein Supportticket erfolgreich an die Admins übergeben!");
    return 1;
    }
    else if(SupDuty[i] == 0)
    {
    SendClientMessage(playerid,Rot,"Es sind keine Supporter anwesend!");
    return 1;
    }
    }
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:ac(playerid,params[])
    {
    new pID;
    if(sscanf(params,"u",pID))return SendClientMessage(playerid,Grau,"Benutze: /ac(ceptsupport) [Spieler-ID]");
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    if(TicketGeschrieben[pID] == 1)
    {
    new adminlevel[56];
    if(GetPVarInt(playerid,"Adminlevel")==1)format(adminlevel,sizeof(adminlevel),"Supporter");
    else if(GetPVarInt(playerid,"Adminlevel")==3)format(adminlevel,sizeof(adminlevel),"Moderator");
    else if(GetPVarInt(playerid,"Adminlevel")==1335)format(adminlevel,sizeof(adminlevel),"Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1337)format(adminlevel,sizeof(adminlevel),"Lead-Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1338)format(adminlevel,sizeof(adminlevel),"Serverinhaber");
    new suptext[128];
    format(suptext,sizeof(suptext),"[GUR]%s %s hat dein Supportticket angenommen. Du kannst nun über die Taste T mit ihm schreiben",adminlevel,PlayerName(playerid));
    new string[128];
    format(string,sizeof(string),"%s %s hat den Support von %s(ID: %d) angenommen!",adminlevel,PlayerName(playerid),PlayerName(pID),pID);
    InSupport[playerid] = 1;
    Supporter[pID] = playerid;
    InSupportt[pID] = 1;
    SetPlayerColor(playerid,Schwarz);
    SendClientMessage(pID,dr,suptext);
    DeinSupport[playerid] = pID;
    DeinSupport[pID] = playerid;
    new Support[64];
    format(Support,sizeof(Support),"/Supports/Support_%s.ini",PlayerName(pID));
    dini_Remove(Support);
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(isPlayerAnAdmin(i,GetPVarInt(playerid,"Adminlevel")))
    {
    SendClientMessage(i,admwarn2,string);
    }
    }
    }
    return 1;
    }
    else if(TicketGeschrieben[pID] == 0)
    {
    SendClientMessage(playerid,Rot,"Dieser Spieler hat kein Supportticket eingereicht!");
    return 1;
    }
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:cs(playerid,params[])
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    if(InSupport[playerid] == 1)
    {
    new Person = DeinSupport[playerid];
    InSupportt[Person] = 0;
    InSupport[playerid] = 0;
    SendClientMessage(Person,Grau,"Der Supporter hat den Supportchat geschlossen");
    SendClientMessage(playerid,Grau,"Du hast den Supportchat geschlossen");
    return 1;
    }
    }
    return 1;
    }

    Spoiler anzeigen
    ocmd:de(playerid,params[])
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    new pID;
    if(sscanf(params,"u",pID))return SendClientMessage(playerid,Grau,"Benutze: /de(letesupport) [Spieler-ID]");
    {
    new adminlevel[56];
    if(GetPVarInt(playerid,"Adminlevel")==1)format(adminlevel,sizeof(adminlevel),"Supporter");
    else if(GetPVarInt(playerid,"Adminlevel")==3)format(adminlevel,sizeof(adminlevel),"Moderator");
    else if(GetPVarInt(playerid,"Adminlevel")==1335)format(adminlevel,sizeof(adminlevel),"Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1337)format(adminlevel,sizeof(adminlevel),"Lead-Admin");
    else if(GetPVarInt(playerid,"Adminlevel")==1338)format(adminlevel,sizeof(adminlevel),"Serverinhaber");
    new userstring[128];
    format(userstring,sizeof(userstring),"%s %s hat dein Supportticket gelöscht!",adminlevel,PlayerName(playerid));
    new string[128];
    format(string,sizeof(string),"%s %s hat das Supportticket von %s gelöscht!",adminlevel,PlayerName(playerid),PlayerName(pID));
    new Support[64];
    format(Support,sizeof(Support),"/Supports/Support_%s.ini",PlayerName(pID));
    dini_Remove(Support);
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(isPlayerAnAdmin(i,GetPVarInt(playerid,"Adminlevel")))
    {
    SendClientMessage(i,admwarn2,string);
    }
    }
    }
    SendClientMessage(pID,admwarn2,userstring);
    TicketGeschrieben[pID] = 0;
    return 1;
    }
    }
    return 1;
    }


    doch Leider, funktioniert es nicht.


    Was ist Falsch?


    lg
    Deagle

  • if(InSupport[playerid] >= 1)
    In der ersten Abfrage -.-