Szerző Téma: 2-nél több oldalas menü készítése  (Megtekintve 765 alkalommal)

2-nél több oldalas menü készítése
« Dátum: 2013. május 13. - 19:48:00 »
0 Show voters
Sziasztok!
Van egy race modom és verseny építésnél 2-oldalas menübõl lehet kocsit választani.Összesen 22db kocsi-közül lehet választani.
Valaki le tudja nekem írni hogy kell +oldalt hozzá adni?Illetve ha nem lehet hogy írjam át dialogba?Sajnos kezdõ vagyok.Válaszotokat elõre is köszönöm!
 
public OnPlayerSelectedMenuRow(playerid, row)
{
/*   if (row==0)
{
    SetTimerEx(\"showVotes\",800,0,\"d\",playerid);
return 0;
}*/
new Menu:Current = GetPlayerMenu(playerid);
if (Current == voteMenu)
{
new vmsg[256],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(vmsg,256,\"* %s szavazott: %s\",pname,gVoteItems[row]);
SendClientMessageToAll(COLOR_GREEN,vmsg);
gVotes[row]++;
TogglePlayerControllable(playerid,1);
return 1;
} else if (Current == buildMenu[xRaceBuilding[playerid]-1])
{
    print(\"Doing something in buildmenu\");
    switch (xRaceBuilding[playerid])
    {
    case 1:
    {
      switch (row)
      {
          case 0: xWorldTime[playerid] = 0;
          case 1: xWorldTime[playerid] = 3;
          case 2: xWorldTime[playerid] = 6;
          case 3: xWorldTime[playerid] = 9;
          case 4: xWorldTime[playerid] = 12;
          case 5: xWorldTime[playerid] = 15;
          case 6: xWorldTime[playerid] = 18;
          case 7: xWorldTime[playerid] = 21;
      }
    }
    case 2:
    {
      switch (row)
      {
          case 0: xWeatherID[playerid] = 0;
          case 1: xWeatherID[playerid] = 10;
          case 2: xWeatherID[playerid] = 12;
          case 3: xWeatherID[playerid] = 16;
          case 4: xWeatherID[playerid] = 16;
          case 5: xWeatherID[playerid] = 19;
          case 6: xWeatherID[playerid] = 39;
          case 7: xWeatherID[playerid] = 35;
      }
    }
    case 3:
    {
      switch (row)
      {
          case 0: xTrackTime[playerid] = 60;
          case 1: xTrackTime[playerid] = 120;
          case 2: xTrackTime[playerid] = 180;
          case 3: xTrackTime[playerid] = 240;
          case 4: xTrackTime[playerid] = 300;
          case 5: xTrackTime[playerid] = 360;
          case 6: xTrackTime[playerid] = 480;
          case 7: xTrackTime[playerid] = 600;
          case 8: xTrackTime[playerid] = 900;
          case 9: xTrackTime[playerid] = 1800;
          case 10: xTrackTime[playerid] = 3600;
      }
    }
    case 4:
    {
      switch (row)
      {
          case 0: xRaceType[playerid] = 1;
          case 1: xRaceType[playerid] = 2;
      }
    }
    case 5:
    {
      switch (row)
      {
          case 0: xCarIds[playerid][0] = 495;
                    case 1: xCarIds[playerid][0] = 402;
                    case 2: xCarIds[playerid][0] = 411;
          case 3: xCarIds[playerid][0] = 451;
          case 4: xCarIds[playerid][0] = 565;
          case 5: xCarIds[playerid][0] = 429;
          case 6: xCarIds[playerid][0] = 415;
          case 7: xCarIds[playerid][0] = 558;
          case 8: xCarIds[playerid][0] = 522;
          case 9: xCarIds[playerid][0] = 468;
          case 10: xCarIds[playerid][0] = 513;
          case 11: xCarIds[playerid][0] = 0, print(\"More..\");
      }
      if (xCarIds[playerid][0] > 0)
      {
          SetPlayerVirtualWorld(playerid, playerid+100);
          printf(\"playerVirtual: %d world:%d\",playerid, playerid+100);
         newCar(playerid);
      }
    }
    case 6:
    {
      switch (row)
      {
          case 0: xCarIds[playerid][0] = 562;
                    case 1: xCarIds[playerid][0] = 480;
                    case 2: xCarIds[playerid][0] = 477;
          case 3: xCarIds[playerid][0] = 560;
          case 4: xCarIds[playerid][0] = 506;
          case 5: xCarIds[playerid][0] = 567;
          case 6: xCarIds[playerid][0] = 424;
          case 7: xCarIds[playerid][0] = 556;
          case 8: xCarIds[playerid][0] = 541;
          case 9: xCarIds[playerid][0] = 494;
          case 10: xCarIds[playerid][0] = 500;
          case 11: xCarIds[playerid][0] = 0, print(\"More..\");
      }
      if (xCarIds[playerid][0] > 0)
      {
          SetPlayerVirtualWorld(playerid, playerid+100);
          printf(\"playerVirtual: %d world:%d\",playerid, playerid+100);
         newCar(playerid);
      }
    }
    }
   
    printf(\"DEBUG: xCarIds=%d xracebuilding=%d\",xCarIds[playerid][0],xRaceBuilding[playerid]);
    //HideMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
xRaceBuilding[playerid]++;
printf(\"xRaceBuilding=%d\",xRaceBuilding[playerid]);
if (xCarIds[playerid][0]==0)
{
    switch (xRaceBuilding[playerid])
    {
      case 7:
      {
          xRaceBuilding[playerid]=xRaceBuilding[playerid]-2;
         ShowMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
      }
        default:
      {
         ShowMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
      }
    }
   print(\"Got here\");
}
else {
    SendClientMessage(playerid, COLOR_PURPLE, \"Add meg a verseny nevét. (/set [név])\");
   printf(\"SER RACE NAME; racebuilding %d; pworld:%d\",xRaceBuilding[playerid], playerid+100);
}
return 1;
}
return 1;
}
És még:
createBuildMenus()
{
buildMenu[0] = CreateMenu(\"~g~1/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[0], 0, \"Valassz napszakot!\");
AddMenuItem(buildMenu[0],0,\"0:00\");
AddMenuItem(buildMenu[0],0,\"3:00\");
AddMenuItem(buildMenu[0],0,\"6:00\");
AddMenuItem(buildMenu[0],0,\"9:00\");
AddMenuItem(buildMenu[0],0,\"12:00\");
AddMenuItem(buildMenu[0],0,\"15:00\");
AddMenuItem(buildMenu[0],0,\"18:00\");
AddMenuItem(buildMenu[0],0,\"21:00\");
buildMenu[1] = CreateMenu(\"~g~2/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[1], 0, \"Valassz idojarast!\");
AddMenuItem(buildMenu[1],0,\"Normal\");
AddMenuItem(buildMenu[1],0,\"Napos\");
AddMenuItem(buildMenu[1],0,\"Szurke\");
AddMenuItem(buildMenu[1],0,\"Esos\");
AddMenuItem(buildMenu[1],0,\"Vihar\");
AddMenuItem(buildMenu[1],0,\"Homokvihar\");
AddMenuItem(buildMenu[1],0,\"Rendkivul fenyes\");
AddMenuItem(buildMenu[1],0,\"Matt barna\");
buildMenu[2] = CreateMenu(\"~g~3/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[2], 0, \"Versenyre szant ido.\");
AddMenuItem(buildMenu[2],0,\"1 perc\");
AddMenuItem(buildMenu[2],0,\"2 perc\");
AddMenuItem(buildMenu[2],0,\"3 perc\");
AddMenuItem(buildMenu[2],0,\"4 perc\");
AddMenuItem(buildMenu[2],0,\"5 perc\");
AddMenuItem(buildMenu[2],0,\"6 perc\");
AddMenuItem(buildMenu[2],0,\"8 perc\");
AddMenuItem(buildMenu[2],0,\"10 perc\");
AddMenuItem(buildMenu[2],0,\"15 perc\");
AddMenuItem(buildMenu[2],0,\"30 perc\");
AddMenuItem(buildMenu[2],0,\"1 ora\");
buildMenu[3] = CreateMenu(\"~g~4/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[3], 0, \"Valassz verseny tipust!\");
AddMenuItem(buildMenu[3],0,\"Normal\");
AddMenuItem(buildMenu[3],0,\"Repulo\");
buildMenu[4] = CreateMenu(\"~g~5/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[4], 0, \"Valassz jarmuvet!\");
AddMenuItem(buildMenu[4],0,\"Sandking\");
AddMenuItem(buildMenu[4],0,\"Buffalo\");
AddMenuItem(buildMenu[4],0,\"Infernus\");
AddMenuItem(buildMenu[4],0,\"Turismo\");
AddMenuItem(buildMenu[4],0,\"Flash\");
AddMenuItem(buildMenu[4],0,\"Banshee\");
AddMenuItem(buildMenu[4],0,\"Cheetah\");
AddMenuItem(buildMenu[4],0,\"Uranus\");
AddMenuItem(buildMenu[4],0,\"NRG 500\");
AddMenuItem(buildMenu[4],0,\"Sanchez\");
AddMenuItem(buildMenu[4],0,\"Stunt Plane\");
AddMenuItem(buildMenu[4],0,\"Tovabbi jarmu...\");
buildMenu[5] = CreateMenu(\"~g~5/5\",1, 200.0, 125.0, 220.0, 50.0);
SetMenuColumnHeader(buildMenu[5], 0, \"Valassz jarmuvet!\");
AddMenuItem(buildMenu[5],0,\"Elegy\");
AddMenuItem(buildMenu[5],0,\"Comet\");
AddMenuItem(buildMenu[5],0,\"ZR-350\");
AddMenuItem(buildMenu[5],0,\"Sultan\");
AddMenuItem(buildMenu[5],0,\"SuperGT\");
AddMenuItem(buildMenu[5],0,\"Savanna\");
AddMenuItem(buildMenu[5],0,\"BF Injection\");
AddMenuItem(buildMenu[5],0,\"Monster\");
AddMenuItem(buildMenu[5],0,\"Bullet\");
AddMenuItem(buildMenu[5],0,\"Hotring\");
AddMenuItem(buildMenu[5],0,\"Mesa\");
AddMenuItem(buildMenu[5],0,\"Vissza...\");//back
}

 
Elõre is köszönöm!
« Utoljára szerkesztve: 2013. május 13. - 19:50:27 írta yamaha14 »

2-nél több oldalas menü készítése
« Válasz #1 Dátum: 2013. május 15. - 17:10:07 »
0 Show voters
Ha jól nézem akkor itt a megoldás
 
             case 0: xCarIds[playerid][0] = 495;
                    case 1: xCarIds[playerid][0] = 402;
                    case 2: xCarIds[playerid][0] = 411;
          case 3: xCarIds[playerid][0] = 451;
          case 4: xCarIds[playerid][0] = 565;
          case 5: xCarIds[playerid][0] = 429;
          case 6: xCarIds[playerid][0] = 415;
          case 7: xCarIds[playerid][0] = 558;
          case 8: xCarIds[playerid][0] = 522;
          case 9: xCarIds[playerid][0] = 468;
          case 10: xCarIds[playerid][0] = 513;
          case 11: xCarIds[playerid][0] = 0, print(\"More..\");
      }
      if (xCarIds[playerid][0] > 0)
      {
          SetPlayerVirtualWorld(playerid, playerid+100);
          printf(\"playerVirtual: %d world:%d\",playerid, playerid+100);
         newCar(playerid);
      }
    }
    case 6:
    {
      switch (row)
      {
          case 0: xCarIds[playerid][0] = 562;
                    case 1: xCarIds[playerid][0] = 480;
                    case 2: xCarIds[playerid][0] = 477;
          case 3: xCarIds[playerid][0] = 560;
          case 4: xCarIds[playerid][0] = 506;
          case 5: xCarIds[playerid][0] = 567;
          case 6: xCarIds[playerid][0] = 424;
          case 7: xCarIds[playerid][0] = 556;
          case 8: xCarIds[playerid][0] = 541;
          case 9: xCarIds[playerid][0] = 494;
          case 10: xCarIds[playerid][0] = 500;
          case 11: xCarIds[playerid][0] = 0,

 
 case 11: xCarIds[playerid][0] = 0 akkor csinálsz egy újat case 12: xCarIds[playerid][0] = Autó id-t keresel wikirõl.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal