hlmod.hu
https://hlmod.hu/

feladat ölés
https://hlmod.hu/viewtopic.php?f=9&t=27676
Oldal: 1 / 1

Szerző:  adriansr14 [ 2017.05.05. 14:22 ]
Hozzászólás témája:  feladat ölés

Sziasztok!
Azt hogyan lehet megoldani hogy
Beírom hogy /fel - erre kiad egy menüt amiben ezek vannak:
1. Ölj meg 5 T (Természetesen ha T vagyok akkor így írja hogy? CT-t)
2. Ölj meg 10 T-t (Ha az első nincs megoldva, addig ezt ne fusson le, csak ha az elsőt végig csinálta)
És ha ezek sikerül akkor kapjanak kis pénzt.
1-ha sikerül pl 4000Forint
2-ha sikerül pl 10000Forint
PL a forint:
  1. Forint[id] += FORINT_menu;
  2.             ColorChat(id, GREEN, "%s ^3%s Sikeres feladat -- Kaptál +%d Forintot!", menu_prefix, Nev, FORINT_menu);


Előreis köszönöm!

Szerző:  Zoe [ 2017.05.06. 02:30 ]
Hozzászólás témája:  Re: feladat ölés

Lefordul teszt nem volt. Teszteld ha nem jo szolj es javitom.
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <colorchat>
  5. #include <cstrike>
  6.  
  7. #define PLUGIN ""
  8. #define VERSION "1.0"
  9. #define AUTHOR "Zoe"
  10.  
  11. new iForint[33], iOles[33], iOk[33];
  12.  
  13. new const iPrefix[] = "ForintRendszer";
  14.  
  15. public plugin_init() {
  16.     register_plugin(PLUGIN, VERSION, AUTHOR);
  17.     register_clcmd("say /forint", "ForintMenu");
  18.     register_event("DeathMsg", "iHalal", "a");
  19. }
  20. public iHalal()
  21. {
  22.     new iId = read_data(1);
  23.    
  24.     if(iId == read_data(2)) return;
  25.    
  26.     switch(cs_get_user_team(iId))
  27.     {
  28.         case CS_TEAM_CT:
  29.         {
  30.             iOles[iId] ++;
  31.         }
  32.         case CS_TEAM_T:
  33.         {
  34.             iOles[iId] ++;
  35.         }
  36.     }
  37. }
  38. public ForintMenu(iId)
  39. {
  40.     new iString[121], iMenu;
  41.     format(iString, charsmax(iString), "Feladat Menü");
  42.     iMenu = menu_create(iString, "Forint_h");
  43.    
  44.     if(iOles[iId] >= 5)
  45.     {
  46.         format(iString, charsmax(iString), "Őlj meg 5 %s", cs_get_user_team(iId) == CS_TEAM_T ? "T":"CT");
  47.         menu_additem(iMenu, iString, "0", 0);
  48.     }
  49.     if(iOk[iId] == 0)
  50.     {
  51.         format(iString, charsmax(iString), "\dŐlj meg 10 %s", cs_get_user_team(iId) == CS_TEAM_T ? "T":"CT");
  52.         menu_additem(iMenu, iString, "1", 0);
  53.     }
  54.     else
  55.     {
  56.         if(iOles[iId] >= 10)
  57.         {
  58.             format(iString, charsmax(iString), "Őlj meg 10 %s", cs_get_user_team(iId) == CS_TEAM_T ? "T":"CT");
  59.             menu_additem(iMenu, iString, "1", 0);
  60.         }
  61.     }
  62.    
  63.     menu_display(iId, iMenu, 0);
  64. }
  65. public Forint_h(iId, iMenu, iKey)
  66. {
  67.     switch(iKey)
  68.     {
  69.         case MENU_EXIT:
  70.         {
  71.             menu_destroy(iMenu);
  72.             return;
  73.         }
  74.         case 0:
  75.         {
  76.             if(iOles[iId] >= 5)
  77.             {
  78.                 iForint[iId] += 4000;
  79.                 iOles[iId] -= 5;
  80.                 iOk[iId] = 1;
  81.                 ColorChat(iId, NORMAL, "^4%s ^1Sikeres Feladat -- Kaptál ^44000 ^1Forintot!", iPrefix);
  82.             }
  83.         }
  84.         case 1:
  85.         {
  86.             if(iOles[iId] >= 10)
  87.             {
  88.                 iForint[iId] += 10000;
  89.                 iOles[iId] = 0;
  90.                 iOk[iId] = 0;
  91.                 ColorChat(iId, NORMAL, "^4%s ^1Sikeres Feladat -- Kaptál ^410000 ^1Forintot!", iPrefix);
  92.             }
  93.         }
  94.     }
  95. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/