Dialog Bug

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
  • Will es so machen das man /duty, als ARMY nen Dialog kriegt.
    Aber er kriegt kein Dialog.
    Wenn ich dann /duty mache steht da, ".. nimmt seine ... "
    Und wenn ich nochma /duty mache das selbe, also gehe ich praktisch nich duty.




    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsACop(playerid))
    {
    if(SwatDuty[playerid]==1)
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist gerade SWAT Duty und kannst nicht Duty gehen!");
    return 1;
    }
    if (IsPlayerInRangeOfPoint(playerid,10.0,290.2056,-108.0194,1001.5156)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0 || PilotDuty[playerid]==0 || SniperDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(IsPlayerInFrac(playerid,1))
    {
    SetPlayerColor(playerid,0x0000FFFF);
    SetPlayerSkin(playerid,280);
    OnDuty[playerid] = 1;
    }
    if(IsPlayerInFrac(playerid,22))
    {
    SetPlayerSkin(playerid,280);
    SetPlayerColor(playerid,0x0000FFFF);
    OnDuty[playerid] = 1;
    }
    else if(IsPlayerInFrac(playerid,3))
    {
    SetPlayerSkin(playerid,287);
    OnDuty[playerid] = 1;
    ShowPlayerDialog(playerid,DIALOG_ARMYDUTY,DIALOG_STYLE_LIST,"Wie möchtest du Duty gehen?","Normal Duty\nPilot Duty\nSniper Duty","Ok","");
    }
    else if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerColor(playerid,0x000000FF); // Copfarbe
    SetPlayerSkin(playerid,286);
    OnDuty[playerid] = 1;
    }
    }
    else if(OnDuty[playerid]==1 || PilotDuty[playerid]==1 || SniperDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    SetPlayerColor(playerid,COLOR_WHITE); // white
    OnDuty[playerid] = 0; SniperDuty[playerid] = 0; PilotDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keiner Umkleide !");
    return 1;
    }
    }

    Dialog

    if(dialogid == DIALOG_ARMYDUTY)
    {
    if(response)
    {
    if(listitem == 0)
    {
    OnDuty[playerid] = 1;
    }
    if(listitem == 1)
    {
    OnDuty[playerid] = 0;
    PilotDuty[playerid] = 1;
    SetPlayerColor(playerid,0xFFFFFF00);
    }
    if(listitem == 2)
    {
    OnDuty[playerid] = 0;
    SniperDuty[playerid] = 1;
    SetPlayerColor(playerid,0xFFFFFF00);
    }
    }
    }

    Einmal editiert, zuletzt von KevinE ()

  • if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsACop(playerid))
    {
    if(SwatDuty[playerid]==1)
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist gerade SWAT Duty und kannst nicht Duty gehen!");
    return 1;
    }
    if (IsPlayerInRangeOfPoint(playerid,10.0,290.2056,-108.0194,1001.5156)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(IsPlayerInFrac(playerid,1))
    {
    SetPlayerColor(playerid,0x0000FFFF);
    SetPlayerSkin(playerid,280);
    OnDuty[playerid] = 1;
    }
    if(IsPlayerInFrac(playerid,22))
    {
    SetPlayerSkin(playerid,280);
    SetPlayerColor(playerid,0x0000FFFF);
    OnDuty[playerid] = 1;
    }
    else if(IsPlayerInFrac(playerid,3))
    {
    SetPlayerSkin(playerid,287);
    //OnDuty[playerid] = 1;
    ShowPlayerDialog(playerid,DIALOG_ARMYDUTY,DIALOG_STYLE_LIST,"Wie möchtest du Duty gehen?","Normal Duty\nPilot Duty\nSniper Duty","Ok","");
    }
    else if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerColor(playerid,0x000000FF); // Copfarbe
    SetPlayerSkin(playerid,286);
    OnDuty[playerid] = 1;
    }
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    SetPlayerColor(playerid,COLOR_WHITE); // white
    OnDuty[playerid] = 0;
    }
    else if(SniperDuty[playerid]==1)
    {
    format(string, sizeof(string), "Schwarfschütze %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    SetPlayerColor(playerid,COLOR_WHITE); // white
    SniperDuty[playerid] = 0;
    }
    else if(PilotDuty[playerid]==1)
    {
    format(string, sizeof(string), "Pilot %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    SetPlayerColor(playerid,COLOR_WHITE); // white
    PilotDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keiner Umkleide !");
    return 1;
    }
    }
    Klappt nicht.

  • Ich versteh die aussage nicht, tut mir leid.
    Aber um den verdammten Bug zu beheben muss du nur die Abfrage anpassen.


    Derzeit fragst du ab:
    if(OnDuty[playerid]==0 || PilotDuty[playerid]==0 || SniperDuty[playerid]==0)
    Heißt soviel wie:
    Ist Spieler im Dienst, oder ist Spieler im Pilotendienst, oder ist Spieler im Sniperdienst..
    Sobald eine dieser Abfragen zutreffen wird der teil in den Klammern ausgeführt.


    Aber die "Fragen" dürfen ja alle nicht zutreffen, damit man nicht mehrmals in den Dienst gehen.
    Also fragen wir ab:
    Ist der Spieler nicht im Dienst, und ist er auch nicht im Pilotendienst, und ist er auch nicht im Sniperdienst.
    if(OnDuty[playerid]==0 && PilotDuty[playerid]==0 && SniperDuty[playerid]==0)



    Wenns geht darfste mich feiern :D

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen

  • Oops sry dein Post oben hat mich irritiert sry


  • if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsACop(playerid))
    {
    if(SwatDuty[playerid]==1)
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist gerade SWAT Duty und kannst nicht Duty gehen!");
    return 1;
    }
    if (IsPlayerInRangeOfPoint(playerid,10.0,290.2056,-108.0194,1001.5156)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0 && PilotDuty[playerid]==0 && SniperDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(IsPlayerInFrac(playerid,1))
    {
    SetPlayerColor(playerid,0x0000FFFF);
    SetPlayerSkin(playerid,280);
    OnDuty[playerid] = 1;
    }
    if(IsPlayerInFrac(playerid,22))
    {
    SetPlayerSkin(playerid,280);
    SetPlayerColor(playerid,0x0000FFFF);
    OnDuty[playerid] = 1;
    }
    else if(IsPlayerInFrac(playerid,3))
    {
    SetPlayerSkin(playerid,287);
    //OnDuty[playerid] = 1;
    ShowPlayerDialog(playerid,DIALOG_ARMYDUTY,DIALOG_STYLE_LIST,"Wie möchtest du Duty gehen?","Normal Duty\nPilot Duty\nSniper Duty","Ok","");
    }
    else if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerColor(playerid,0x000000FF); // Copfarbe
    SetPlayerSkin(playerid,286);
    OnDuty[playerid] = 1;
    }
    }
    else if(OnDuty[playerid]==1 || SniperDuty[playerid]==1 || PilotDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    SetPlayerColor(playerid,COLOR_WHITE); // white
    OnDuty[playerid] = 0; PilotDuty[playerid] = 0; SniperDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keiner Umkleide !");
    return 1;
    }
    }


    Geht Nicht.
    Ich möchte das " ShowPlayerDialog(playerid,DIALOG_ARMYDUTY,DIALOG_STYLE_LIST,"Wie möchtest du Duty gehen?","Normal Duty\nPilot Duty\nSniper Duty","Ok",""); "
    'Das funktioniert, weil der Dialog sich nicht öffnet!

    2 Mal editiert, zuletzt von KevinE ()