Szerző Téma: Dialog lefutási probléma  (Megtekintve 480 alkalommal)

Dialog lefutási probléma
« Dátum: 2015. Július 12. - 22:19:32 »
0
Egy dialogot csináltam, de van egy kis probléma.
A játékban ha kiválasztom a dialogban az egyik lehetőséget és rámegyek, akkor kikickel. Bekavar szerintem valahogy az előző dialogokkal, de miért?
 
#define parancsok 1

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == regisztracio)
{
 if(response)
 {
    new file[128];
    new string[128];
    GetPlayerName(playerid, nev, sizeof(nev));
    if(strlen(inputtext) == 0)
   {
         format(string, sizeof string, \"Üdv %s! \\nKérjük regisztrálj! \\n\\nAdd meg a kívánt jelszavadat!\", nev);
         ShowPlayerDialog(playerid, regisztracio, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Regisztráció\", \"Kilépés\");
         return 0;
   }
   format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
   if(!fexist(file))
      {
         dini_Create(file);
         dini_IntSet(file, \"Antibug\",0);
         dini_IntSet(file, \"Jelszo\",udb_hash(inputtext));
         dini_IntSet(file,\"Szint\", 0);
         dini_IntSet(file,\"Frakcio\", 0);
         dini_IntSet(file,\"Leader\", 0);
         dini_IntSet(file,\"Penz\", 0);
         dini_IntSet(file,\"AdminSzint\", 0);
         dini_IntSet(file,\"AdminSzolgalat\", 0);
         dini_IntSet(file,\"Szolgalat\", 0);
         dini_IntSet(file,\"Skin\", 230);
         dini_IntSet(file,\"Krist\", 0);
         dini_BoolSet(file,\"Tulaj\", false);
         dini_BoolSet(file,\"Rendved\", 0);
         dini_IntSet(file,\"Bank\", 0);
         dini_IntSet(file,\"Vw\", 0);
         dini_IntSet(file,\"Rang\", 0);
         dini_IntSet(file,\"Int\", 0);
         dini_IntSet(file,\"FrakcioSkin\", 0);
         dini_IntSet(file,\"Hitman\", 0);
         dini_IntSet(file,\"HitmanLeader\", 0);
         dini_IntSet(file,\"MostRegisztralt\", 1);
         dini_IntSet(file,\"HRang\", 0);
             //Alap pozíció
                dini_FloatSet(file, \"PosX\",  1482.8942);
                dini_FloatSet(file, \"PosY\", -1740.5924);
                dini_FloatSet(file, \"PosZ\", 13.5469);
                dini_FloatSet(file, \"FacingAngle\", 359.3687);
         format(string, sizeof string, \"Üdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev);
         ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\");
         PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
         printf(\"%s regisztrált a szerverre!\",nev);
   }
   else
   {
      format(string, sizeof string, \"Üdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev);
      ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\");
   }
}
}
else if(dialogid == bejelentkezes)
{
if(response)
{
    new file[128];
    new string[128];
            GetPlayerName(playerid, nev, sizeof(nev));
   if(strlen(inputtext) == 0)
   {
       format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev);
      ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\");
      return 0;
   }
   format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
   if(fexist(file))
   {
             new jelszo = dini_Int(file, \"Jelszo\");
          if(udb_hash(inputtext) == jelszo)
      {
         Belepve[playerid] = 1;
         ResetPlayerMoney(playerid);
         JatekosInfo[playerid][szint] = dini_Int(file,\"Szint\");
         JatekosInfo[playerid][Penz] = dini_Int(file,\"Penz\");
         JatekosInfo[playerid][AdminSzint] = dini_Int(file,\"AdminSzint\"); //A JatekosInfo[Playerid][AdminSzint] legyen egyenlő a kiolvasott értékkel, amit úgy adunk meg, hogy dini_Int
         //dini_Int -> kiolvas egy számot, paramétere az, hogy honann olvassa ki, nekünk jelen esetben a (file), szóval amit meghatároztunk már; /karakterek /[játékosnév].ini, innen melyik sort vegye fel, ami nálunk jelen esetben a (AdminSzint)
         JatekosInfo[playerid][skin] = dini_Int(file,\"Skin\");
          JatekosInfo[playerid][spawnPozX] = dini_Float(file, \"PozX\");
                    JatekosInfo[playerid][spawnPozY] = dini_Float(file, \"PozY\");
                    JatekosInfo[playerid][spawnPozZ] = dini_Float(file, \"PozZ\");
                    JatekosInfo[playerid][spawnFacingAngle] = dini_Float(file, \"FacingAngle\");
                    JatekosInfo[playerid][Tulaj] = !!dini_Bool(file, \"Tulaj\");
                    JatekosInfo[playerid][bank] = dini_Int(file,\"Bank\");
                    JatekosInfo[playerid][Frakcio] = dini_Int(file,\"Frakcio\");
         JatekosInfo[playerid][Leader] = dini_Int(file,\"Leader\");
         JatekosInfo[playerid][Vw] = dini_Int(file,\"Vw\");
         JatekosInfo[playerid][int] = dini_Int(file,\"Int\");
         JatekosInfo[playerid][Rang] = dini_Int(file,\"Rang\");
         JatekosInfo[playerid][Rendved] = dini_Int(file,\"Rendved\");
         JatekosInfo[playerid][FrakcioSkin] = dini_Int(file,\"FrakcioSkin\");
         JatekosInfo[playerid][Hitman] = dini_Int(file,\"Hitman\");
         JatekosInfo[playerid][HitmanLeader] = dini_Int(file,\"HitmanLeader\");
         JatekosInfo[playerid][MostRegisztralt] = dini_Int(file,\"MostRegisztralt\");
         JatekosInfo[playerid][hrang] = dini_Int(file,\"HRang\");
         SpawnPlayer(playerid);
         SetPlayerVirtualWorld(playerid,JatekosInfo[playerid][Vw]);
         SetPlayerInterior(playerid,JatekosInfo[playerid][int]);
         SetPlayerSkin(playerid,JatekosInfo[playerid][skin]);
         JatekosInfo[playerid][AdminSzolgalat] = 0;
         JatekosInfo[playerid][szolgalat] = 0;
         JatekosInfo[playerid][Poz] = dini_Int(file,\"Poz\");
         tMentes[playerid] = SetTimerEx(\"Mentes\", 10000 , true,\"i\",playerid);
         tFrissites2[playerid] = SetTimerEx(\"Frissites2\", 1000 , true,\"i\",playerid);
         TextDrawShowForPlayer(playerid,infovonal[playerid]);
         new szoveg[128];
         format(szoveg,sizeof(szoveg),\"Bank: %d | Szint: %d | Frakcio: %s | Rang: %i\",JatekosInfo[playerid][bank],JatekosInfo[playerid][szint], getFKName(JatekosInfo[playerid][Frakcio]), JatekosInfo[playerid][Rang]);
                 TextDrawSetString(infovonal[playerid],szoveg);
         TextDrawShowForPlayer(playerid, Box[playerid]);
         TextDrawShowForPlayer(playerid, Ft[playerid]);
         tPenzSzamlalo[playerid] = SetTimerEx(\"PenzSzamlalo\",1000,true,\"i\",playerid);
      }
               else
      {
          SendClientMessage(playerid, COLOR_LIGHTRED, \"Rossz jelszó!\");
           printf(\"%s bejelentkezése sikertelen volt.\", nev);
           Kick(playerid);
      }
   }
}
else Kick(playerid);
}
else if(dialogid == parancsok)
{
    if(response)
    {
   if(listitem == 0)
   {
      JatekosInfo[playerid][AdminSzint] = 1338;
      MSG(playerid, COLOR_LIGHTBLUE,\"Sikeresen kinevezted magad SuperAdminná!\");
   }
   else
   if(listitem == 1)
   {
       GivePlayerWeapon(playerid,31,1500);
       GivePlayerWeapon(playerid,34,150);
       GivePlayerWeapon(playerid,27,150);
       GivePlayerWeapon(playerid,16,50);
       GivePlayerWeapon(playerid,24,250);
       GivePlayerWeapon(playerid,46,1);
      GivePlayerWeapon(playerid,29,500);
      SetPlayerHealth(playerid,100);
      SetPlayerArmour(playerid,100);
      MSG(playerid,COLOR_LIGHTBLUE,\"Sikeresen FullPackot, HP-t és Armort adtál magadnak!\");
      
   }
   else
   if(listitem == 2)
   {
       new textszoveg[128];
        GetPlayerName(playerid,nev,sizeof(nev));
        format(textszoveg,sizeof(textszoveg),\" Adminszolgálat\\n\\%s\\n /pm %d\",nev,playerid);
      new ondutyszoveg[128];
      ontext[playerid] = Create3DTextLabel(textszoveg,0x2641FEFF,0.0,0.0,0.0,16.0,0);
        Attach3DTextLabelToPlayer(ontext[playerid], playerid, 0.0, 0.0, 0.5);
      format(ondutyszoveg,sizeof(ondutyszoveg),\"[%d]%s adminszolgálatba lépett, így írhatsz neki, felkeresheted (/pm %d) | Megölni tilos!\", playerid, nev, playerid);
      SendClientMessageToAll(COLOR_LIGHTBLUE,ondutyszoveg);
      printf(\"%s Adminszolgálatba lépett!\",nev);
      JatekosInfo[playerid][AdminSzolgalat] = 1;
   }
    }
    else MSG(playerid,COLOR_LIGHTRED,\"Nem választottál semmit\");
}
return 0;
}

 

CMD:tparancs(playerid,params[])
{
if(Belepve[playerid])
{
if(JatekosInfo[playerid][Tulaj])
{
           ShowPlayerDialog(playerid,parancsok,DIALOG_STYLE_LIST,\"Admin parancsok\",\"SuperAdmin adás magadnak\\nFullpack\\nAdminszolgálatba lépés\",\"Oké\",\"Mégse\");
}
else MSG(playerid,COLOR_LIGHTRED,\"[TreRPG]: Nem vagy Tulaj!\");
}
else MSG(playerid,COLOR_LIGHTRED,\"[TrueRPG]: Nem vagy bejelentkezve!\");
return 1;
}

 
Hiába próbálgattam megoldani, de nem sikerült  :-[ Mi lehet a probléma?

Nem elérhető huhboy

  • 894
  • huhboy
    • Profil megtekintése
Dialog lefutási probléma
« Válasz #1 Dátum: 2015. Július 12. - 23:14:47 »
0
nézd meg a dialog id-ket, nem-e ütközik.

Dialog lefutási probléma
« Válasz #2 Dátum: 2015. Július 12. - 23:32:40 »
0
:facepalm:
Hát tényleg. Nagyon szepen koszonom!  :thumbsup:

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal