hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.27. 23:13



Jelenlévő felhasználók

Jelenleg 545 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 544 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: koko.988 az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 
Szerző Üzenet
HozzászólásElküldve: 2023.04.18. 19:04 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 368
Megköszönt másnak: 64 alkalommal
Megköszönték neki: 10 alkalommal
Üdv!

Van a pluginom amiben a régi Főmenüt szeretném cserélni egy kicsit jobb főmenüre és ezért kérek segítséget hogy valaki beletudná nekem írni?

Köszönet előre is! :)

Régi menü kódja!
  1. new const MainStrings[][] = {
  2.         "M4A1 Skinek",
  3.         "AK47 Skinek",
  4.         "AWP Skinek",
  5.         "SCOUT Skinek",
  6.         "FAMAS Skinek",
  7.         "GALIL Skinek",
  8.         "AUG Skinek",
  9.         "M3 Skinek",
  10.         "XM1014 Skinek",
  11.         "KNIFE Skinek",
  12.         "DEAGLE Skinek",
  13.         "USP Skinek",
  14.         "GLOCK18 Skinek"
  15.     };
  16.  
  17. register_clcmd("say /menu", "openMainMenu");
  18.         register_clcmd("say /add", "Addolas");
  19.  
  20. register_impulse(201, "openMainMenu");
  21.  
  22. }
  23.     public openMainMenu(id) {
  24.         new szMenu[121], String[6];
  25.         formatex(szMenu, charsmax(szMenu), "%s \wFőMenü", gChatPrefix);
  26.         new menu = menu_create(szMenu, "hMainMenu");
  27.        
  28.         for(new i ;i < sizeof(MainStrings); i++) {
  29.             num_to_str(i, String, 5);
  30.             formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  31.             menu_additem(menu, szMenu, String);
  32.         }
  33.         menu_display(id, menu, 0);
  34.         return PLUGIN_HANDLED;
  35.     }
  36.     public hMainMenu(id, menu, item) {
  37.         if(item == MENU_EXIT) {
  38.             menu_destroy(menu);
  39.             return PLUGIN_HANDLED;
  40.         }
  41.         g_Wpn[id] = item+1;
  42.         openSkinMenu(id);
  43.         menu_destroy(menu);
  44.         return PLUGIN_HANDLED;
  45.     }
  46.     public openSkinMenu(id) {
  47.             new szMenu[121], szMenu2[64], String[6];
  48.             if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1]);
  49.             else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47]);
  50.             else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP]);
  51.             else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT]);
  52.             else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS]);
  53.             else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL]);
  54.             else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG]);
  55.             else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3]);
  56.             else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014]);
  57.             else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE]);
  58.             else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE]);
  59.             else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP]);
  60.             else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK]);
  61.             new menu = menu_create(szMenu, "hSkinChooser");
  62.  
  63. menu_display(id, menu, 0);
  64.         return PLUGIN_HANDLED;
  65.  
  66. }
  67.     public hSkinChooser(id, menu, item) {
  68.         if(item == MENU_EXIT)
  69.         {
  70.             menu_destroy(menu);
  71.             return PLUGIN_CONTINUE;
  72.         }


Új Menü kódja
  1. register_impulse(201, "main_menu");
  2.        
  3.         register_clcmd("say /menu", "main_menu");
  4.         register_clcmd("say /menu", "main_menu");
  5.  
  6. }
  7.     public main_menu(id)
  8.     {
  9.         new sTitle[128];
  10.         format(sTitle, charsmax(sTitle), "[%s] \r- \dFomenu", gMenuPrefix);
  11.         new iMenu = menu_create(sTitle, "menu_main_h");
  12.        
  13.         menu_additem(iMenu, "\rRaktar", "1", 0);
  14.         menu_additem(iMenu, "\rAdmin menu", "2", 0);
  15.        
  16.         menu_display(id, iMenu, 0);
  17.        
  18.     }
  19.     public menu_main_h(id, menu, item)
  20.     {
  21.         if(item == MENU_EXIT)
  22.         {
  23.             menu_destroy(menu);
  24.             return;
  25.         }
  26.        
  27.         new data[9], Name[64];
  28.         new access, callback;
  29.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  30.         new key = str_to_num(data);
  31.        
  32.         switch(key)
  33.         {
  34.             case 1: menu_storage(id);
  35.             case 2: {
  36.                 if(get_user_flags(id) & TULAJ) SendItems(id);
  37.                 else
  38.                 client_print_color(id, print_team_default, "^3[%s] ^1Ezt a menut csak ^4Tulajdonos ^1hasznalhatja!", gChatPrefix)
  39.             }
  40.         }
  41.     }
  42.     public menu_storage(id)
  43.     {
  44.         new sTitle[128];
  45.         format(sTitle, charsmax(sTitle), "[%s] \r- \dRaktár", gMenuPrefix);
  46.         new iMenu = menu_create(sTitle, "menu_storage_h");
  47.        
  48.         menu_additem(iMenu, "\rM4A1 \ySkinek", "1", 0);
  49.         menu_additem(iMenu, "\rAK47 \ySkinek", "2", 0);
  50.         menu_additem(iMenu, "\rAWP \ySkinek", "3", 0);
  51.         menu_additem(iMenu, "\rSCOUT \ySkinek", "4", 0);
  52.         menu_additem(iMenu, "\rFAMAS \ySkinek", "5", 0);
  53.         menu_additem(iMenu, "\rGALIL  \ySkinek", "6", 0);
  54.         menu_additem(iMenu, "\rAUG \ySkinek", "7", 0);
  55.         menu_additem(iMenu, "\rM3 \ySkinek", "8", 0);
  56.         menu_additem(iMenu, "\rXM1014 \ySkinek", "9", 0);
  57.         menu_additem(iMenu, "\rKNIFE \ySkinek", "10", 0);
  58.         menu_additem(iMenu, "\rDEAGLE \ySkinek", "11", 0);
  59.         menu_additem(iMenu, "\rUSP \ySkinek", "12", 0);
  60.         menu_additem(iMenu, "\rGLOCK18 \ySkinek", "13", 0);
  61.        
  62.         menu_display(id, iMenu, 0);
  63.        
  64.     }
  65.     public menu_storage_h(id, menu, item)
  66.     {
  67.         if(item == MENU_EXIT)
  68.         {
  69.             menu_destroy(menu);
  70.             return;
  71.         }
  72.        
  73.         new data[9], Name[64];
  74.         new access, callback;
  75.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  76.         new key = str_to_num(data);
  77.        
  78.         switch(key)
  79.         {
  80.             case 1..13:{ menu_weapons(id, key); iMenuWeapons = key;}
  81.         }
  82.     }
  83.  
  84. }
  85.             }
  86.         }
  87.         menu_setprop(iMenu, MPROP_BACKNAME, "Vissza");
  88.         menu_setprop(iMenu, MPROP_NEXTNAME, "Tovább");
  89.         menu_setprop(iMenu, MPROP_EXITNAME, "Kilépés");
  90.        
  91.         menu_display(id, iMenu, 0);


Itt elérhető a kód ha valaki esetleg nem látna!


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2023.04.18. 19:13 
Offline
Nagyúr
Avatar

Csatlakozott: 2019.08.20. 18:19
Hozzászólások: 501
Megköszönt másnak: 244 alkalommal
Megköszönték neki: 45 alkalommal
Így gondoltad?

  1. new const MainStrings[][] = {
  2.         "M4A1 Skinek",
  3.         "AK47 Skinek",
  4.         "AWP Skinek",
  5.         "SCOUT Skinek",
  6.         "FAMAS Skinek",
  7.         "GALIL Skinek",
  8.         "AUG Skinek",
  9.         "M3 Skinek",
  10.         "XM1014 Skinek",
  11.         "KNIFE Skinek",
  12.         "DEAGLE Skinek",
  13.         "USP Skinek",
  14.         "GLOCK18 Skinek"
  15.     };
  16.  
  17.     register_clcmd("say /menu", "fomenu");
  18.     register_impulse(201, "fomenu");
  19.     register_clcmd("say /add", "Addolas");
  20.  
  21.  
  22.  
  23. }
  24. public fomenu(id)
  25. {
  26.         new sTitle[128];
  27.         format(sTitle, charsmax(sTitle), "[%s] \r- \dFomenu", gMenuPrefix);
  28.         new iMenu = menu_create(sTitle, "menu_main_h");
  29.        
  30.         menu_additem(iMenu, "\rRaktar", "1", 0);
  31.         menu_additem(iMenu, "\rAdmin menü", "2", 0);
  32.         menu_additem(iMenu, "\rMenüben menü", "3", 0);
  33.        
  34.         menu_display(id, iMenu, 0);
  35.        
  36.     }
  37.     public menu_main_h(id, menu, item)
  38.     {
  39.         if(item == MENU_EXIT)
  40.         {
  41.             menu_destroy(menu);
  42.             return;
  43.         }
  44.        
  45.         new data[9], Name[64];
  46.         new access, callback;
  47.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  48.         new key = str_to_num(data);
  49.        
  50.         switch(key)
  51.         {
  52.             case 1: openMainMenu(id);
  53.             case 2:
  54.             {
  55.                 if(get_user_flags(id) & TULAJ) SendItems(id);
  56.                 else
  57.                 client_print_color(id, print_team_default, "^3[%s] ^1Ezt a menut csak ^4Tulajdonos ^1hasznalhatja!", gChatPrefix)
  58.             }
  59.             case 3: valamimenu(id);
  60.         }
  61.     }
  62. }
  63. public valamimenu(id)
  64. {
  65.         new sTitle[128];
  66.         format(sTitle, charsmax(sTitle), "[%s] \r- \dÁll menü", gMenuPrefix);
  67.         new iMenu = menu_create(sTitle, "main_h");
  68.        
  69.         menu_additem(iMenu, "\rValami menü 1", "1", 0);
  70.         menu_additem(iMenu, "\rValami menü 2", "2", 0);
  71.         menu_additem(iMenu, "\rValami menü 3", "3", 0);
  72.  
  73.  
  74.        
  75.         menu_display(id, iMenu, 0);
  76.        
  77.     }
  78.     public main_h(id, menu, item)
  79.     {
  80.         if(item == MENU_EXIT)
  81.         {
  82.             menu_destroy(menu);
  83.             return;
  84.         }
  85.        
  86.         new data[9], Name[64];
  87.         new access, callback;
  88.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  89.         new key = str_to_num(data);
  90.        
  91.         switch(key)
  92.         {
  93.             case 1: vlmimenu1(id);
  94.             case 2: vlmimenu2(id);
  95.             case 3: vlmimenu3(id);
  96.  
  97.    
  98. }
  99.     public openMainMenu(id)
  100.     {
  101.         new szMenu[121], String[6];
  102.         formatex(szMenu, charsmax(szMenu), "%s \wSkin Menü", gChatPrefix);
  103.         new menu = menu_create(szMenu, "hMainMenu");
  104.        
  105.         for(new i ;i < sizeof(MainStrings); i++) {
  106.             num_to_str(i, String, 5);
  107.             formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  108.             menu_additem(menu, szMenu, String);
  109.         }
  110.         menu_display(id, menu, 0);
  111.         return PLUGIN_HANDLED;
  112.     }
  113.     public hMainMenu(id, menu, item) {
  114.         if(item == MENU_EXIT) {
  115.             menu_destroy(menu);
  116.             return PLUGIN_HANDLED;
  117.         }
  118.         g_Wpn[id] = item+1;
  119.         openSkinMenu(id);
  120.         menu_destroy(menu);
  121.         return PLUGIN_HANDLED;
  122.     }
  123.     public openSkinMenu(id)
  124.     {
  125.             new szMenu[121], szMenu2[64], String[6];
  126.             if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1]);
  127.             else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47]);
  128.             else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP]);
  129.             else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT]);
  130.             else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS]);
  131.             else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL]);
  132.             else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG]);
  133.             else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3]);
  134.             else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014]);
  135.             else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE]);
  136.             else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE]);
  137.             else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP]);
  138.             else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK]);
  139.             new menu = menu_create(szMenu, "hSkinChooser");
  140.  
  141.     menu_display(id, menu, 0);
  142.         return PLUGIN_HANDLED;

_________________
Hamarosan új pluginok lesznek ki terjesztve! :)


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2023.04.18. 19:23 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 368
Megköszönt másnak: 64 alkalommal
Megköszönték neki: 10 alkalommal
8mTNNe írta:
Így gondoltad?

  1. new const MainStrings[][] = {
  2.         "M4A1 Skinek",
  3.         "AK47 Skinek",
  4.         "AWP Skinek",
  5.         "SCOUT Skinek",
  6.         "FAMAS Skinek",
  7.         "GALIL Skinek",
  8.         "AUG Skinek",
  9.         "M3 Skinek",
  10.         "XM1014 Skinek",
  11.         "KNIFE Skinek",
  12.         "DEAGLE Skinek",
  13.         "USP Skinek",
  14.         "GLOCK18 Skinek"
  15.     };
  16.  
  17.     register_clcmd("say /menu", "fomenu");
  18.     register_impulse(201, "fomenu");
  19.     register_clcmd("say /add", "Addolas");
  20.  
  21.  
  22.  
  23. }
  24. public fomenu(id)
  25. {
  26.         new sTitle[128];
  27.         format(sTitle, charsmax(sTitle), "[%s] \r- \dFomenu", gMenuPrefix);
  28.         new iMenu = menu_create(sTitle, "menu_main_h");
  29.        
  30.         menu_additem(iMenu, "\rRaktar", "1", 0);
  31.         menu_additem(iMenu, "\rAdmin menü", "2", 0);
  32.         menu_additem(iMenu, "\rMenüben menü", "3", 0);
  33.        
  34.         menu_display(id, iMenu, 0);
  35.        
  36.     }
  37.     public menu_main_h(id, menu, item)
  38.     {
  39.         if(item == MENU_EXIT)
  40.         {
  41.             menu_destroy(menu);
  42.             return;
  43.         }
  44.        
  45.         new data[9], Name[64];
  46.         new access, callback;
  47.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  48.         new key = str_to_num(data);
  49.        
  50.         switch(key)
  51.         {
  52.             case 1: openMainMenu(id);
  53.             case 2:
  54.             {
  55.                 if(get_user_flags(id) & TULAJ) SendItems(id);
  56.                 else
  57.                 client_print_color(id, print_team_default, "^3[%s] ^1Ezt a menut csak ^4Tulajdonos ^1hasznalhatja!", gChatPrefix)
  58.             }
  59.             case 3: valamimenu(id);
  60.         }
  61.     }
  62. }
  63. public valamimenu(id)
  64. {
  65.         new sTitle[128];
  66.         format(sTitle, charsmax(sTitle), "[%s] \r- \dÁll menü", gMenuPrefix);
  67.         new iMenu = menu_create(sTitle, "main_h");
  68.        
  69.         menu_additem(iMenu, "\rValami menü 1", "1", 0);
  70.         menu_additem(iMenu, "\rValami menü 2", "2", 0);
  71.         menu_additem(iMenu, "\rValami menü 3", "3", 0);
  72.  
  73.  
  74.        
  75.         menu_display(id, iMenu, 0);
  76.        
  77.     }
  78.     public main_h(id, menu, item)
  79.     {
  80.         if(item == MENU_EXIT)
  81.         {
  82.             menu_destroy(menu);
  83.             return;
  84.         }
  85.        
  86.         new data[9], Name[64];
  87.         new access, callback;
  88.         menu_item_getinfo(menu, item, access, data,charsmax(data), Name,charsmax(Name), callback);
  89.         new key = str_to_num(data);
  90.        
  91.         switch(key)
  92.         {
  93.             case 1: vlmimenu1(id);
  94.             case 2: vlmimenu2(id);
  95.             case 3: vlmimenu3(id);
  96.  
  97.    
  98. }
  99.     public openMainMenu(id)
  100.     {
  101.         new szMenu[121], String[6];
  102.         formatex(szMenu, charsmax(szMenu), "%s \wSkin Menü", gChatPrefix);
  103.         new menu = menu_create(szMenu, "hMainMenu");
  104.        
  105.         for(new i ;i < sizeof(MainStrings); i++) {
  106.             num_to_str(i, String, 5);
  107.             formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  108.             menu_additem(menu, szMenu, String);
  109.         }
  110.         menu_display(id, menu, 0);
  111.         return PLUGIN_HANDLED;
  112.     }
  113.     public hMainMenu(id, menu, item) {
  114.         if(item == MENU_EXIT) {
  115.             menu_destroy(menu);
  116.             return PLUGIN_HANDLED;
  117.         }
  118.         g_Wpn[id] = item+1;
  119.         openSkinMenu(id);
  120.         menu_destroy(menu);
  121.         return PLUGIN_HANDLED;
  122.     }
  123.     public openSkinMenu(id)
  124.     {
  125.             new szMenu[121], szMenu2[64], String[6];
  126.             if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1]);
  127.             else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47]);
  128.             else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP]);
  129.             else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT]);
  130.             else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS]);
  131.             else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL]);
  132.             else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG]);
  133.             else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3]);
  134.             else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014]);
  135.             else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE]);
  136.             else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE]);
  137.             else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP]);
  138.             else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK]);
  139.             new menu = menu_create(szMenu, "hSkinChooser");
  140.  
  141.     menu_display(id, menu, 0);
  142.         return PLUGIN_HANDLED;



Hát őszinte leszek most nem igazán ilyenre gondoltam, konkréttan ebből kell Ebből & ebben a kódba


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2023.04.18. 19:41 
Offline
Nagyúr
Avatar

Csatlakozott: 2019.08.20. 18:19
Hozzászólások: 501
Megköszönt másnak: 244 alkalommal
Megköszönték neki: 45 alkalommal
hát jó ember ott van. másold át és ennyi.

_________________
Hamarosan új pluginok lesznek ki terjesztve! :)


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2023.04.20. 19:08 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 368
Megköszönt másnak: 64 alkalommal
Megköszönték neki: 10 alkalommal
8mTNNe írta:
hát jó ember ott van. másold át és ennyi.



Szia!

Szerintem ez így jó lenne,adom a forrást rendben ?!

  1. #include <amxmodx>
  2.     #include <engine>
  3.     #include <fakemeta>
  4.     #include <cstrike>
  5.     #include <sqlx>
  6.     //////////////////////////////////////////////////////
  7.     #define MAXPLAYERS 33 // player id-k lesznek
  8.     #define MAXLVL 50 // max szint
  9.     #define MAXRANK 11 // maximum rang
  10.     #pragma semicolon 1 // mindenhova ahova lehet tegyék ; jelet
  11.     #define ChatColor print_team_default // -1 csak szürke a ^3 -2 csak piros, -3 csak kék, print_team_default az alap
  12.     #define Tablename "skinmenuranked" //SQL Tábla neve!//
  13.     //////////////////////////////////////////////////////
  14.     #define OWNER ADMIN_IMMUNITY // OWnerben taroljuk az immunitas jogot
  15.     #define FOADMIN ADMIN_LEVEL_E // foadminban meg a o jogot
  16.     #define ADMIN ADMIN_MAP // adminban a mapvaltas jogot
  17.     #define VIP ADMIN_LEVEL_H  //vipben meg egy h jogot
  18.     //////////////////////////////////////////////////////
  19.     //(valamelyik előtt mindenképpen legyen // jel!)
  20.     #define RANK_ON // ha latni akarsz rangokat chatben (tulaj admin vip)
  21.     //#define RANK_OFF // ha nem akarsz latni rangokat chatben (tulaj admin vip)
  22.     //(valamelyik előtt mindenképpen legyen // jel!)
  23.     //////////////////////////////////////////////////////
  24.     #define KILL_POINT 1
  25.     #define HEADSHOT_POINT 5
  26.     //////////////////////////////////////////////////////
  27.     enum _:GunDatas {
  28.         M4A1,
  29.         AK47,
  30.         AWP,
  31.         SCOUT,
  32.         FAMAS,
  33.         GALIL,
  34.         AUG,
  35.         M3,
  36.         XM1014,
  37.         KNIFE,
  38.         DEAGLE,
  39.         USP,
  40.         GLOCK
  41.     }
  42.     new g_SelectedGun[33][GunDatas], g_uPoints[33][GunDatas], g_Wpn[33];
  43.     new sSteamID[64];
  44.     new betoltve[33];
  45.     enum _:ePlayer{eXp,eLvl,eRank,eRankCounter,};
  46.     new g_ePlayer[ePlayer][MAXPLAYERS], cvarPrefix, gSyncHud;
  47.    
  48.     new const gMenuPrefix[] = "\w[..::DarK*_*Knight::..]\y";
  49.     new const gChatPrefix[] = "[..::DarK*_*Knight::..]";
  50.      
  51.     enum _:DATA {
  52.         GunName[512],
  53.         ModelName[512],
  54.         Points[8]
  55.    }
  56.    
  57.     enum _:eRanks{eRankName[64], eRankLvl,};
  58.     new const cRanks[MAXRANK][eRanks] = {
  59.         {"Kezdő", 0}, //rang neve, szint
  60.         {"szőlőcukor", 5},
  61.         {"Csöves", 10},
  62.         {"Cukros Bácsi", 15},
  63.         {"Retardált", 20},
  64.         {"Hajléktalan", 25},
  65.         {"Fogyatékos", 30},
  66.         {"Drogos", 35},
  67.         {"Szittyós", 40},
  68.         {"Gyerekrabló", 45},
  69.         {"Rabszolgatartó", MAXLVL} //bővíteni ? MAXLVLt írd át a max szintre és mindenképpen legalulra kerüljön! | a szinteket ötösével adjad meg ha lehet! mert ha nem elfog csúszni a rang.
  70.     };
  71.    
  72.     new const WeaponM4A1[][DATA] = {
  73.         {"M4A1 | Default", "models/v_m4a1.mdl", 0, }
  74.     };
  75.     new const WeaponAK47[][DATA] = {
  76.         {"AK47 | Default", "models/v_ak47.mdl", 0, }
  77.     };
  78.     new const WeaponAWP[][DATA] = {
  79.         {"AWP | Default", "models/v_awp.mdl", 0, },
  80.     };
  81.     new const WeaponSCOUT[][DATA] = {
  82.         {"SCOUT | Default", "models/v_scout.mdl", 0, }
  83.     };
  84.     new const WeaponFAMAS[][DATA] = {
  85.         {"FAMAS | Default", "models/v_famas.mdl", 0, }
  86.     };
  87.     new const WeaponGALIL[][DATA] = {
  88.         {"GALIL | Default", "models/v_galil.mdl", 0, }
  89.     };
  90.     new const WeaponAUG[][DATA] = {
  91.         {"AUG | Default", "models/v_aug.mdl", 0, }
  92.     };
  93.     new const WeaponM3[][DATA] = {
  94.         {"M3 | Default", "models/v_m3.mdl", 0, }
  95.     };
  96.     new const WeaponXM1014[][DATA] = {
  97.         {"XM1014 | Default", "models/v_xm1014.mdl", 0, }
  98.     };
  99.     new const WeaponKNIFE[][DATA] = {
  100.         {"KNIFE | Default", "models/v_knife.mdl", 0, }
  101.     };
  102.     new const WeaponDEAGLE[][DATA] = {
  103.         {"DEAGLE | Default", "models/v_deagle.mdl", 0, }
  104.     };
  105.     new const WeaponUSP[][DATA] = {
  106.         {"USP | Default", "models/v_usp.mdl", 0, }
  107.     };
  108.     new const WeaponGLOCK[][DATA] = {
  109.         {"GLOCK18 | Default", "models/v_glock18.mdl", 0, }
  110.     };
  111.     new const MainStrings[][] = {
  112.         "M4A1 Skinek",
  113.         "AK47 Skinek",
  114.         "AWP Skinek",
  115.         "SCOUT Skinek",
  116.         "FAMAS Skinek",
  117.         "GALIL Skinek",
  118.         "AUG Skinek",
  119.         "M3 Skinek",
  120.         "XM1014 Skinek",
  121.         "KNIFE Skinek",
  122.         "DEAGLE Skinek",
  123.         "USP Skinek",
  124.         "GLOCK18 Skinek"
  125.     };
  126.     public plugin_init() {
  127.         register_plugin("Hlmodra", "valamiverziosiskell?", "szeretjükatejetazbiztos!");
  128.         register_clcmd("say /menu", "openMainMenu");
  129.         register_clcmd("say /add", "Addolas");
  130.        
  131.         register_impulse(201, "openMainMenu");
  132.        
  133.         register_event("DeathMsg","Halal","a");
  134.         register_event("CurWeapon", "evChangeWeapon", "be", "1=1");
  135.        
  136.         register_clcmd("say /info", "info_p");
  137.         //register_clcmd("say /rs", "statreset_p");
  138.        
  139.         register_event("DeathMsg", "ev_deathmsg", "a");
  140.        
  141.         cvarPrefix = register_cvar("Prefix", "^4[..::DarK*_*Knight::..]^3 »");
  142.        
  143.         ////////////////////////////////////////
  144.         register_clcmd("say", "sayhook");      //Maradjon alul!
  145.         ////////////////////////////////////////
  146.        
  147.         gSyncHud = CreateHudSyncObj();
  148.     }
  149.     public info_p(id)
  150.     {
  151.         new Xp, Xp2;
  152.         Xp = 15+g_ePlayer[eLvl][id];
  153.         Xp2 = 15*30+g_ePlayer[eLvl][id]*Xp;
  154.         client_print_color(id, ChatColor, "%s^1 Rangod: %s | Szinted/Xpd: %d/%d | Következő rang: %s", gChatPrefix, cRanks[g_ePlayer[eRank][id]][eRankName],
  155.         g_ePlayer[eXp][id], Xp2, cRanks[g_ePlayer[eRank][id]+1][eRankName]);
  156.     }
  157.     public client_PreThink(id)
  158.         LvlCheck(id);
  159.      
  160.     public LvlCheck(id)
  161.     {
  162.         if(g_ePlayer[eLvl][id] == MAXLVL || g_ePlayer[eRank][id] == MAXRANK)
  163.             return PLUGIN_HANDLED;
  164.        
  165.         new Xp, Xp2, sName[64];
  166.         Xp = 15+g_ePlayer[eLvl][id];
  167.         Xp2 = 15*30+g_ePlayer[eLvl][id]*Xp;
  168.        
  169.         if(g_ePlayer[eXp][id] >= Xp2)
  170.         {
  171.             g_ePlayer[eLvl][id]++;
  172.             g_ePlayer[eXp][id] = 0;
  173.             g_ePlayer[eRankCounter][id]++;
  174.            
  175.             if(g_ePlayer[eRankCounter][id] == 5)
  176.             {
  177.                 g_ePlayer[eRank][id]++;
  178.                 g_ePlayer[eRankCounter][id] = 0;
  179.             }
  180.             get_user_name(id, sName, charsmax(sName));
  181.             client_print_color(0, ChatColor, "^4%s^3 %s^1 szintet lépett, szintje: ^4%d.", gChatPrefix, sName, g_ePlayer[eLvl][id]);
  182.         }
  183.         return PLUGIN_HANDLED;
  184.     }
  185.     public ev_deathmsg()
  186.     {
  187.         new iKiller = read_data(1);
  188.         new iVictim = read_data(2);
  189.         new iHs = read_data(3);
  190.         new iRnd, sName[64];
  191.        
  192.         if(!iKiller || !iVictim || iVictim == iKiller)
  193.             return PLUGIN_HANDLED;
  194.        
  195.         get_user_name(iVictim, sName, charsmax(sName));
  196.        
  197.         if(iHs)
  198.         {
  199.             iRnd = random_num(5, 10);
  200.             g_ePlayer[eXp][iKiller] += iRnd;
  201.             client_print_color(iKiller, ChatColor, "%s^1 Kaptál^3 %d^1 Xp-t^3 %s^1 fejbelövéséért!", gChatPrefix, iRnd, sName);
  202.         }
  203.         else
  204.         {
  205.             iRnd = random_num(1, 5);
  206.             g_ePlayer[eXp][iKiller] += iRnd;
  207.             client_print_color(iKiller, ChatColor, "%s^1 Kaptál^3 %d^1 Xp-t^3 %s^1 megöléséért!", gChatPrefix, iRnd, sName);
  208.         }
  209.         return PLUGIN_HANDLED_MAIN;
  210.         }
  211.     public hudshow_p(id)
  212.     {
  213.         if(!is_user_connected(id))
  214.             return PLUGIN_HANDLED_MAIN;
  215.        
  216.         new sText[256], iLen, idT;
  217.         new Target = pev(id, pev_iuser1) == 4 ? pev(id, pev_iuser2) : id;
  218.         idT = is_user_alive(id) ? id:Target;
  219.        
  220.         new Xp, Xp2;
  221.         Xp = 15+g_ePlayer[eLvl][idT];
  222.         Xp2 = 15*30+g_ePlayer[eLvl][idT]*Xp;
  223.        
  224.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "Szint: [ %d --> %d ]^n", g_ePlayer[eLvl][idT], MAXLVL);
  225.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "Rang: -- %s --^n", cRanks[g_ePlayer[eRank][idT]][eRankName]);
  226.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "XP: [ %d --> %d ]", g_ePlayer[eXp][idT], Xp2);
  227.        
  228.         set_hudmessage(0, 255, 0, -1.0, 0.85, 0, 6.0, 1.0, 0.1, 0.2, -1);
  229.         ShowSyncHudMsg(id, gSyncHud, "%s", sText);
  230.        
  231.         set_task(1.0, "hudshow_p", id);
  232.        
  233.         return PLUGIN_HANDLED;
  234.     }
  235.     public Addolas(id)
  236.     {
  237.         g_uPoints[id][M4A1] += 50;
  238.         g_uPoints[id][AK47] += 50;
  239.         g_uPoints[id][AWP] += 50;
  240.         g_uPoints[id][SCOUT] += 50;
  241.         g_uPoints[id][FAMAS] += 50;
  242.         g_uPoints[id][GALIL] += 50;
  243.         g_uPoints[id][AUG] += 50;
  244.         g_uPoints[id][M3] += 50;
  245.         g_uPoints[id][XM1014] += 50;
  246.         g_uPoints[id][KNIFE] += 50;
  247.         g_uPoints[id][DEAGLE] += 50;
  248.         g_uPoints[id][USP] += 50;
  249.         g_uPoints[id][GLOCK] += 50;
  250.     }
  251.     public plugin_precache() {
  252.         for(new i;i < sizeof(WeaponM4A1); i++) precache_model(WeaponM4A1[i][ModelName]);
  253.         for(new i;i < sizeof(WeaponAK47); i++) precache_model(WeaponAK47[i][ModelName]);
  254.         for(new i;i < sizeof(WeaponAWP); i++) precache_model(WeaponAWP[i][ModelName]);
  255.         for(new i;i < sizeof(WeaponSCOUT); i++) precache_model(WeaponSCOUT[i][ModelName]);
  256.         for(new i;i < sizeof(WeaponFAMAS); i++) precache_model(WeaponFAMAS[i][ModelName]);
  257.         for(new i;i < sizeof(WeaponGALIL); i++) precache_model(WeaponGALIL[i][ModelName]);
  258.         for(new i;i < sizeof(WeaponAUG); i++) precache_model(WeaponAUG[i][ModelName]);
  259.         for(new i;i < sizeof(WeaponM3); i++) precache_model(WeaponM3[i][ModelName]);
  260.         for(new i;i < sizeof(WeaponXM1014); i++) precache_model(WeaponXM1014[i][ModelName]);
  261.         for(new i;i < sizeof(WeaponKNIFE); i++) precache_model(WeaponKNIFE[i][ModelName]);
  262.         for(new i;i < sizeof(WeaponDEAGLE); i++) precache_model(WeaponDEAGLE[i][ModelName]);
  263.         for(new i;i < sizeof(WeaponUSP); i++) precache_model(WeaponUSP[i][ModelName]);
  264.         for(new i;i < sizeof(WeaponGLOCK); i++) precache_model(WeaponGLOCK[i][ModelName]);
  265.     }
  266.     public evChangeWeapon(id) {
  267.         switch(get_user_weapon(id)) {
  268.             case CSW_M4A1: entity_set_string(id, EV_SZ_viewmodel, WeaponM4A1[g_SelectedGun[id][M4A1]][ModelName]);
  269.                 case CSW_AK47: entity_set_string(id, EV_SZ_viewmodel, WeaponAK47[g_SelectedGun[id][AK47]][ModelName]);
  270.                 case CSW_AWP: entity_set_string(id, EV_SZ_viewmodel, WeaponAWP[g_SelectedGun[id][AWP]][ModelName]);
  271.                 case CSW_SCOUT: entity_set_string(id, EV_SZ_viewmodel, WeaponSCOUT[g_SelectedGun[id][SCOUT]][ModelName]);
  272.                 case CSW_FAMAS: entity_set_string(id, EV_SZ_viewmodel, WeaponFAMAS[g_SelectedGun[id][FAMAS]][ModelName]);
  273.                 case CSW_GALIL: entity_set_string(id, EV_SZ_viewmodel, WeaponGALIL[g_SelectedGun[id][GALIL]][ModelName]);
  274.                 case CSW_AUG: entity_set_string(id, EV_SZ_viewmodel, WeaponAUG[g_SelectedGun[id][AUG]][ModelName]);
  275.                 case CSW_M3: entity_set_string(id, EV_SZ_viewmodel, WeaponM3[g_SelectedGun[id][M3]][ModelName]);
  276.                 case CSW_XM1014: entity_set_string(id, EV_SZ_viewmodel, WeaponXM1014[g_SelectedGun[id][XM1014]][ModelName]);
  277.                 case CSW_KNIFE: entity_set_string(id, EV_SZ_viewmodel, WeaponKNIFE[g_SelectedGun[id][KNIFE]][ModelName]);
  278.                 case CSW_DEAGLE: entity_set_string(id, EV_SZ_viewmodel, WeaponDEAGLE[g_SelectedGun[id][DEAGLE]][ModelName]);
  279.                 case CSW_USP: entity_set_string(id, EV_SZ_viewmodel, WeaponUSP[g_SelectedGun[id][USP]][ModelName]);
  280.                 case CSW_GLOCK18: entity_set_string(id, EV_SZ_viewmodel, WeaponGLOCK[g_SelectedGun[id][GLOCK]][ModelName]);
  281.             }
  282.         return PLUGIN_CONTINUE;
  283.     }
  284.     public Halal() {
  285.        
  286.         new iAttacker = read_data(1);
  287.         new iVictim = read_data(2);
  288.         new iHs = read_data(3);
  289.        
  290.         if(iAttacker == iVictim || iAttacker == 0) return PLUGIN_HANDLED;
  291.         new iPoints = iHs ? HEADSHOT_POINT : KILL_POINT;
  292.        
  293.         switch(get_user_weapon(iAttacker)) {
  294.             case CSW_M4A1: g_uPoints[iAttacker][M4A1] += iPoints;
  295.                 case CSW_AK47: g_uPoints[iAttacker][AK47] += iPoints;
  296.                 case CSW_AWP: g_uPoints[iAttacker][AWP] += iPoints;
  297.                 case CSW_SCOUT: g_uPoints[iAttacker][SCOUT] += iPoints;
  298.                 case CSW_FAMAS: g_uPoints[iAttacker][FAMAS] += iPoints;
  299.                 case CSW_GALIL: g_uPoints[iAttacker][GALIL] += iPoints;
  300.                 case CSW_AUG: g_uPoints[iAttacker][AUG] += iPoints;
  301.                 case CSW_M3: g_uPoints[iAttacker][M3] += iPoints;
  302.                 case CSW_XM1014: g_uPoints[iAttacker][XM1014] += iPoints;
  303.                 case CSW_KNIFE: g_uPoints[iAttacker][KNIFE] += iPoints;
  304.                 case CSW_DEAGLE: g_uPoints[iAttacker][DEAGLE] += iPoints;
  305.                 case CSW_USP: g_uPoints[iAttacker][USP] += iPoints;
  306.                 case CSW_GLOCK18: g_uPoints[iAttacker][GLOCK] += iPoints;
  307.             }
  308.         set_hudmessage(random(256), random(256), random(256), -1.0, 0.20, 0, 6.0, 3.0);
  309.         show_hudmessage(iAttacker, "+%i Pont", iPoints);
  310.         return PLUGIN_CONTINUE;
  311.     }
  312.     public openMainMenu(id) {
  313.         new szMenu[121], String[6];
  314.         formatex(szMenu, charsmax(szMenu), "%s \wFőMenü", gChatPrefix);
  315.         new menu = menu_create(szMenu, "hMainMenu");
  316.        
  317.         for(new i ;i < sizeof(MainStrings); i++) {
  318.             num_to_str(i, String, 5);
  319.             formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  320.             menu_additem(menu, szMenu, String);
  321.         }
  322.         menu_display(id, menu, 0);
  323.         return PLUGIN_HANDLED;
  324.     }
  325.     public hMainMenu(id, menu, item) {
  326.         if(item == MENU_EXIT) {
  327.             menu_destroy(menu);
  328.             return PLUGIN_HANDLED;
  329.         }
  330.         g_Wpn[id] = item+1;
  331.         openSkinMenu(id);
  332.         menu_destroy(menu);
  333.         return PLUGIN_HANDLED;
  334.     }
  335.     public openSkinMenu(id) {
  336.             new szMenu[121], szMenu2[64], String[6];
  337.             if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1]);
  338.             else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47]);
  339.             else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP]);
  340.             else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT]);
  341.             else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS]);
  342.             else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL]);
  343.             else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG]);
  344.             else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3]);
  345.             else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014]);
  346.             else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE]);
  347.             else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE]);
  348.             else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP]);
  349.             else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\r[\dPontjaid: \y%i\r]", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK]);
  350.             new menu = menu_create(szMenu, "hSkinChooser");
  351.        
  352.         if(g_Wpn[id] == 1) {
  353.             for(new i; i < sizeof(WeaponM4A1); i++) {
  354.                 num_to_str(i, String, 5);
  355.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponM4A1[i][Points]);
  356.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM4A1[i][GunName], g_SelectedGun[id][M4A1] == i ? "\y{Kiválasztva}": szMenu2);
  357.                 menu_additem(menu, szMenu, String);
  358.             }
  359.         }
  360.         else if(g_Wpn[id] == 2) {
  361.             for(new i; i < sizeof(WeaponAK47); i++) {
  362.                 num_to_str(i, String, 5);
  363.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponAK47[i][Points]);
  364.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAK47[i][GunName], g_SelectedGun[id][AK47] == i ? "\y{Kiválasztva}": szMenu2);
  365.                 menu_additem(menu, szMenu, String);
  366.             }
  367.         }
  368.         else if(g_Wpn[id] == 3) {
  369.             for(new i; i < sizeof(WeaponAWP); i++) {
  370.                 num_to_str(i, String, 5);
  371.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponAWP[i][Points]);
  372.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAWP[i][GunName], g_SelectedGun[id][AWP] == i ? "\y{Kiválasztva}": szMenu2);
  373.                 menu_additem(menu, szMenu, String);
  374.             }
  375.         }
  376.         else if(g_Wpn[id] == 4) {
  377.             for(new i; i < sizeof(WeaponSCOUT); i++) {
  378.                 num_to_str(i, String, 5);
  379.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponSCOUT[i][Points]);
  380.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponSCOUT[i][GunName], g_SelectedGun[id][SCOUT] == i ? "\y{Kiválasztva}": szMenu2);
  381.                 menu_additem(menu, szMenu, String);
  382.             }
  383.         }
  384.         else if(g_Wpn[id] == 5) {
  385.             for(new i; i < sizeof(WeaponFAMAS); i++) {
  386.                 num_to_str(i, String, 5);
  387.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponFAMAS[i][Points]);
  388.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponFAMAS[i][GunName], g_SelectedGun[id][FAMAS] == i ? "\y{Kiválasztva}": szMenu2);
  389.                 menu_additem(menu, szMenu, String);
  390.             }
  391.         }
  392.         else if(g_Wpn[id] == 6) {
  393.             for(new i; i < sizeof(WeaponGALIL); i++) {
  394.                 num_to_str(i, String, 5);
  395.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponGALIL[i][Points]);
  396.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGALIL[i][GunName], g_SelectedGun[id][GALIL] == i ? "\y{Kiválasztva}": szMenu2);
  397.                 menu_additem(menu, szMenu, String);
  398.             }
  399.         }
  400.         else if(g_Wpn[id] == 7) {
  401.             for(new i; i < sizeof(WeaponAUG); i++) {
  402.                 num_to_str(i, String, 5);
  403.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponAUG[i][Points]);
  404.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAUG[i][GunName], g_SelectedGun[id][AUG] == i ? "\y{Kiválasztva}": szMenu2);
  405.                 menu_additem(menu, szMenu, String);
  406.             }
  407.         }
  408.         else if(g_Wpn[id] == 8) {
  409.             for(new i; i < sizeof(WeaponM3); i++) {
  410.                 num_to_str(i, String, 5);
  411.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponM3[i][Points]);
  412.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM3[i][GunName], g_SelectedGun[id][M3] == i ? "\y{Kiválasztva}": szMenu2);
  413.                 menu_additem(menu, szMenu, String);
  414.             }
  415.         }
  416.         else if(g_Wpn[id] == 9) {
  417.             for(new i; i < sizeof(WeaponXM1014); i++) {
  418.                 num_to_str(i, String, 5);
  419.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponXM1014[i][Points]);
  420.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponXM1014[i][GunName], g_SelectedGun[id][XM1014] == i ? "\y{Kiválasztva}": szMenu2);
  421.                 menu_additem(menu, szMenu, String);
  422.             }
  423.         }
  424.         else if(g_Wpn[id] == 10) {
  425.             for(new i; i < sizeof(WeaponKNIFE); i++) {
  426.                 num_to_str(i, String, 5);
  427.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponKNIFE[i][Points]);
  428.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponKNIFE[i][GunName], g_SelectedGun[id][KNIFE] == i ? "\y{Kiválasztva}": szMenu2);
  429.                 menu_additem(menu, szMenu, String);
  430.             }
  431.         }
  432.         else if(g_Wpn[id] == 11) {
  433.             for(new i; i < sizeof(WeaponDEAGLE); i++) {
  434.                 num_to_str(i, String, 5);
  435.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponDEAGLE[i][Points]);
  436.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponDEAGLE[i][GunName], g_SelectedGun[id][DEAGLE] == i ? "\y{Kiválasztva}": szMenu2);
  437.                 menu_additem(menu, szMenu, String);
  438.             }
  439.         }
  440.         else if(g_Wpn[id] == 12) {
  441.             for(new i; i < sizeof(WeaponUSP); i++) {
  442.                 num_to_str(i, String, 5);
  443.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponUSP[i][Points]);
  444.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponUSP[i][GunName], g_SelectedGun[id][USP] == i ? "\y{Kiválasztva}": szMenu2);
  445.                 menu_additem(menu, szMenu, String);
  446.             }
  447.         }
  448.         else if(g_Wpn[id] == 13) {
  449.             for(new i; i < sizeof(WeaponGLOCK); i++) {
  450.                 num_to_str(i, String, 5);
  451.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Pont", WeaponGLOCK[i][Points]);
  452.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGLOCK[i][GunName], g_SelectedGun[id][GLOCK] == i ? "\y{Kiválasztva}": szMenu2);
  453.                 menu_additem(menu, szMenu, String);
  454.             }
  455.         }
  456.         menu_display(id, menu, 0);
  457.         return PLUGIN_HANDLED;
  458.     }
  459.     public hSkinChooser(id, menu, item) {
  460.         if(item == MENU_EXIT)
  461.         {
  462.             menu_destroy(menu);
  463.             return PLUGIN_CONTINUE;
  464.         }
  465.         switch(g_Wpn[id]) {
  466.             case 1: {
  467.                 if(g_uPoints[id][M4A1] >= WeaponM4A1[item][Points]) {
  468.                     g_SelectedGun[id][M4A1] = item;
  469.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  470.                 }
  471.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  472.             }
  473.             case 2: {
  474.                 if(g_uPoints[id][AK47] >= WeaponAK47[item][Points]) {
  475.                     g_SelectedGun[id][AK47] = item;
  476.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  477.                 }
  478.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  479.             }
  480.             case 3: {
  481.                 if(g_uPoints[id][AWP] >= WeaponAWP[item][Points]) {
  482.                     g_SelectedGun[id][AWP] = item;
  483.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  484.                 }
  485.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  486.             }
  487.             case 4: {
  488.                 if(g_uPoints[id][SCOUT] >= WeaponSCOUT[item][Points]) {
  489.                     g_SelectedGun[id][SCOUT] = item;
  490.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  491.                 }
  492.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  493.             }
  494.             case 5: {
  495.                 if(g_uPoints[id][FAMAS] >= WeaponFAMAS[item][Points]) {
  496.                     g_SelectedGun[id][FAMAS] = item;
  497.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  498.                 }
  499.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  500.             }
  501.             case 6: {
  502.                 if(g_uPoints[id][GALIL] >= WeaponGALIL[item][Points]) {
  503.                     g_SelectedGun[id][GALIL] = item;
  504.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  505.                 }
  506.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  507.             }
  508.             case 7: {
  509.                 if(g_uPoints[id][AUG] >= WeaponAUG[item][Points]) {
  510.                     g_SelectedGun[id][AUG] = item;
  511.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  512.                 }
  513.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  514.             }
  515.             case 8: {
  516.                 if(g_uPoints[id][M3] >= WeaponM3[item][Points]) {
  517.                     g_SelectedGun[id][M3] = item;
  518.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  519.                 }
  520.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  521.             }
  522.             case 9: {
  523.                 if(g_uPoints[id][XM1014] >= WeaponXM1014[item][Points]) {
  524.                     g_SelectedGun[id][XM1014] = item;
  525.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  526.                 }
  527.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  528.             }
  529.             case 10: {
  530.                 if(g_uPoints[id][KNIFE] >= WeaponKNIFE[item][Points]) {
  531.                     g_SelectedGun[id][KNIFE] = item;
  532.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  533.                 }
  534.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  535.             }
  536.             case 11: {
  537.                 if(g_uPoints[id][DEAGLE] >= WeaponDEAGLE[item][Points]) {
  538.                     g_SelectedGun[id][DEAGLE] = item;
  539.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  540.                 }
  541.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  542.             }
  543.             case 12: {
  544.                 if(g_uPoints[id][USP] >= WeaponUSP[item][Points]) {
  545.                     g_SelectedGun[id][USP] = item;
  546.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  547.                 }
  548.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  549.             }
  550.             case 13: {
  551.                 if(g_uPoints[id][GLOCK] >= WeaponGLOCK[item][Points]) {
  552.                     g_SelectedGun[id][GLOCK] = item;
  553.                     client_print_color(id, print_team_default, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  554.                 }
  555.                 else client_print_color(id, print_team_default, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  556.             }
  557.         }
  558.         menu_destroy(menu);
  559.         return PLUGIN_HANDLED;
  560.     }
  561.     public client_putinserver(id)
  562.     {
  563.         if(is_user_bot(id))
  564.             return;
  565.                
  566.         set_task(5.0, "hudshow_p", id);
  567.        
  568.         betoltve[id] = false;
  569.         g_ePlayer[id][eLvl] = 0;
  570.         g_ePlayer[id][eXp] = 0;
  571.         g_ePlayer[id][eRank] = 0;
  572.         g_ePlayer[id][eRankCounter] = 0;
  573.         g_uPoints[id][M4A1] = 0;
  574.         g_uPoints[id][AK47] = 0;
  575.         g_uPoints[id][AWP] = 0;
  576.         g_uPoints[id][SCOUT] = 0;
  577.         g_uPoints[id][FAMAS] = 0;
  578.         g_uPoints[id][GALIL] = 0;
  579.         g_uPoints[id][AUG] = 0;
  580.         g_uPoints[id][M3] = 0;
  581.         g_uPoints[id][XM1014] = 0;
  582.         g_uPoints[id][KNIFE] = 0;
  583.         g_uPoints[id][DEAGLE] = 0;
  584.         g_uPoints[id][USP] = 0;
  585.         g_uPoints[id][GLOCK] = 0;
  586.         g_SelectedGun[id][M4A1] = 0;
  587.         g_SelectedGun[id][AK47] = 0;
  588.         g_SelectedGun[id][AWP] = 0;
  589.         g_SelectedGun[id][SCOUT] = 0;
  590.         g_SelectedGun[id][FAMAS] = 0;
  591.         g_SelectedGun[id][GALIL] = 0;
  592.         g_SelectedGun[id][AUG] = 0;
  593.         g_SelectedGun[id][M3] = 0;
  594.         g_SelectedGun[id][XM1014] = 0;
  595.         g_SelectedGun[id][KNIFE] = 0;
  596.         g_SelectedGun[id][DEAGLE] = 0;
  597.         g_SelectedGun[id][USP] = 0;
  598.         g_SelectedGun[id][GLOCK] = 0;
  599.        
  600.         SelectDataTable(id);
  601.     }
  602.     public client_disconnected(id)
  603.     {
  604.         if(is_user_bot(id))
  605.             return;
  606.        
  607.         TableUpdate(id);
  608.        
  609.         if(task_exists(id))
  610.             remove_task(id);
  611.     }
  612.     new Handle:g_SqlTuple;
  613.     public plugin_cfg()
  614.     {
  615.         //Kiszolgáló | Felhasználó | Jelszó | Adatbázis
  616.        
  617.         g_SqlTuple = SQL_MakeDbTuple("mysql.srkhost.eu:3306", "u952_mavMGzrSyv", "", "s952_skinmenuranked");
  618.         CreateTable();
  619.     }
  620.     public CreateTable(){
  621.         new iLen;
  622.         static sQuery[10048];
  623.        
  624.         iLen += formatex(sQuery[iLen], charsmax(sQuery), "CREATE TABLE IF NOT EXISTS `%s` ", Tablename);
  625.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "( ");
  626.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`Id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,");
  627.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`SteamId` varchar(64) NOT NULL,");
  628.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`qSzint` int(11) NOT NULL,");
  629.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`qXp` int(11) NOT NULL,");
  630.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`qRank` int(11) NOT NULL,");
  631.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`qRankCounter` int(11) NOT NULL,");
  632.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM4A1` int(11) NOT NULL,");
  633.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAK47` int(11) NOT NULL,");
  634.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAWP` int(11) NOT NULL,");
  635.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsSCOUT` int(11) NOT NULL,");
  636.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsFAMAS` int(11) NOT NULL,");
  637.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGALIL` int(11) NOT NULL,");
  638.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAUG` int(11) NOT NULL,");
  639.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM3` int(11) NOT NULL,");
  640.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsXM1014` int(11) NOT NULL,");
  641.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsKNIFE` int(11) NOT NULL,");
  642.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsDEAGLE` int(11) NOT NULL,");
  643.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsUSP` int(11) NOT NULL,");
  644.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGLOCK` int(11) NOT NULL,");
  645.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM4A1` int(11) NOT NULL,");
  646.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAK47` int(11) NOT NULL,");
  647.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAWP` int(11) NOT NULL,");
  648.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunSCOUT` int(11) NOT NULL,");
  649.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunFAMAS` int(11) NOT NULL,");
  650.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGALIL` int(11) NOT NULL,");
  651.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAUG` int(11) NOT NULL,");
  652.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM3` int(11) NOT NULL,");
  653.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunXM1014` int(11) NOT NULL,");
  654.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunKNIFE` int(11) NOT NULL,");
  655.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunDEAGLE` int(11) NOT NULL,");
  656.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunUSP` int(11) NOT NULL,");
  657.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGLOCK` int(11) NOT NULL)");
  658.        
  659.         SQL_ThreadQuery(g_SqlTuple, "TableCreateThread", sQuery);
  660.     }
  661.     public TableUpdate(id)
  662.     {
  663.         if(betoltve[id]) {
  664.             static sQuery[10048];
  665.             new iLen, sSteamID[64];
  666.             get_user_authid(id, sSteamID, charsmax(sSteamID));
  667.            
  668.             iLen += formatex(sQuery[iLen], charsmax(sQuery), "UPDATE `%s` SET ", Tablename);
  669.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "qSzint = ^"%i^",", g_ePlayer[id][eLvl]);
  670.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "qXp = ^"%i^",", g_ePlayer[id][eXp]);
  671.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "qRank = ^"%i^",", g_ePlayer[id][eRank]);
  672.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "qRankCounter = ^"%i^",", g_ePlayer[id][eRankCounter]);
  673.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM4A1 = ^"%i^",", g_uPoints[id][M4A1]);
  674.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAK47 = ^"%i^",", g_uPoints[id][AK47]);
  675.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAWP = ^"%i^",", g_uPoints[id][AWP]);
  676.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsSCOUT = ^"%i^",", g_uPoints[id][SCOUT]);
  677.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsFAMAS = ^"%i^",", g_uPoints[id][FAMAS]);
  678.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGALIL = ^"%i^",", g_uPoints[id][GALIL]);
  679.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAUG = ^"%i^",", g_uPoints[id][AUG]);
  680.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM3 = ^"%i^",", g_uPoints[id][M3]);
  681.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsXM1014 = ^"%i^",", g_uPoints[id][XM1014]);
  682.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsKNIFE = ^"%i^",", g_uPoints[id][KNIFE]);
  683.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsDEAGLE = ^"%i^",", g_uPoints[id][DEAGLE]);
  684.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsUSP = ^"%i^",", g_uPoints[id][USP]);
  685.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGLOCK = ^"%i^",", g_uPoints[id][GLOCK]);
  686.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAK47 = ^"%i^",", g_SelectedGun[id][AK47]);
  687.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAWP = ^"%i^",", g_SelectedGun[id][AWP]);
  688.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunSCOUT = ^"%i^",", g_SelectedGun[id][SCOUT]);
  689.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunFAMAS = ^"%i^",", g_SelectedGun[id][FAMAS]);
  690.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGALIL = ^"%i^",", g_SelectedGun[id][GALIL]);
  691.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAUG = ^"%i^",", g_SelectedGun[id][AUG]);
  692.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM3 = ^"%i^",", g_SelectedGun[id][M3]);
  693.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunXM1014 = ^"%i^",", g_SelectedGun[id][XM1014]);
  694.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunKNIFE = ^"%i^",", g_SelectedGun[id][KNIFE]);
  695.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunDEAGLE = ^"%i^",", g_SelectedGun[id][DEAGLE]);
  696.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunUSP = ^"%i^",", g_SelectedGun[id][USP]);
  697.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGLOCK = ^"%i^",", g_SelectedGun[id][GLOCK]);
  698.            
  699.             iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM4A1 = ^"%i^" WHERE `SteamId` = ^"%s^";", g_SelectedGun[id][M4A1], sSteamID);
  700.             SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  701.         }
  702.     }
  703.     public TableCreateThread(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  704.     {
  705.         if(iFailState == TQUERY_CONNECT_FAILED)
  706.             set_fail_state("[Create] Nem lehet csatlakozni az adatbazishoz!");
  707.         else if(iFailState == TQUERY_QUERY_FAILED)
  708.             set_fail_state("[Create] Lekerdezesi hiba");
  709.         if(iErrcode)
  710.             log_amx("[Create] Hiba:**!! %s !!**", sError);
  711.     }
  712.     public TableInsert(id)
  713.     {
  714.         static sQuery[10048], sSteamID[64];
  715.        
  716.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  717.         formatex(sQuery, charsmax(sQuery), "INSERT INTO `%s` (`SteamId`) VALUES (^"%s^");", Tablename, sSteamID);
  718.         SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  719.         betoltve[id] = true;
  720.     }
  721.     public SelectDataTable(id)
  722.     {
  723.         static sQuery[10048];
  724.         new sData[1], sSteamID[64];
  725.         sData[0] = id;
  726.        
  727.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  728.        
  729.         formatex(sQuery, charsmax(sQuery), "SELECT * FROM `%s` WHERE SteamId = ^"%s^";", Tablename, sSteamID);
  730.         SQL_ThreadQuery(g_SqlTuple, "QuerySelectDataTable", sQuery, sData, 1);
  731.     }
  732.     public QuerySelectDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  733.     {
  734.         if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  735.         {
  736.             log_amx("[Insert] Hiba:**!! %s !!**", sError);
  737.             return;
  738.         }
  739.         else
  740.         {
  741.             new id = sData[0];
  742.            
  743.             if(SQL_NumRows(sQuery) > 0)
  744.             {
  745.                 g_ePlayer[id][eLvl] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "qSzint"));
  746.                 g_ePlayer[id][eXp] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "qXp"));
  747.                 g_ePlayer[id][eRank] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "qRank"));
  748.                 g_ePlayer[id][eRankCounter] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "qRankCounter"));
  749.                 g_uPoints[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM4A1"));
  750.                 g_uPoints[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAK47"));
  751.                 g_uPoints[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAWP"));
  752.                 g_uPoints[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsSCOUT"));
  753.                 g_uPoints[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsFAMAS"));
  754.                 g_uPoints[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGALIL"));
  755.                 g_uPoints[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAUG"));
  756.                 g_uPoints[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM3"));
  757.                 g_uPoints[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsXM1014"));
  758.                 g_uPoints[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsKNIFE"));
  759.                 g_uPoints[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsDEAGLE"));
  760.                 g_uPoints[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsUSP"));
  761.                 g_uPoints[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGLOCK"));
  762.                 g_SelectedGun[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM4A1"));
  763.                 g_SelectedGun[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAK47"));
  764.                 g_SelectedGun[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAWP"));
  765.                 g_SelectedGun[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunSCOUT"));
  766.                 g_SelectedGun[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunFAMAS"));
  767.                 g_SelectedGun[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGALIL"));
  768.                 g_SelectedGun[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAUG"));
  769.                 g_SelectedGun[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM3"));
  770.                 g_SelectedGun[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunXM1014"));
  771.                 g_SelectedGun[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunKNIFE"));
  772.                 g_SelectedGun[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunDEAGLE"));
  773.                 g_SelectedGun[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunUSP"));
  774.                 g_SelectedGun[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGLOCK"));
  775.                 betoltve[id] = true;
  776.             }
  777.             else
  778.                 TableInsert(id);
  779.         }
  780.     }
  781.     public QuerySetDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  782.     {
  783.         if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  784.         {
  785.             log_amx("[SetData] Hiba:**!! %s !!**", sError);
  786.             return;
  787.         }
  788.     }
  789.     public sayhook(id)
  790.     {
  791.         new sMessage[512], sText[128], sDeath[16], iLen, sName[64];
  792.         read_args(sMessage, charsmax(sMessage));
  793.         remove_quotes(sMessage);
  794.        
  795.         if(strlen(sMessage) == 0 || sMessage[0] == '/' || sMessage[0] == '@')
  796.             return PLUGIN_HANDLED_MAIN;
  797.        
  798.         new iTeam, iColor;
  799.         iTeam = get_user_team(id);
  800.        
  801.         switch(iTeam) //itt lehet elvalasztani hogy ha ctk irnak a tk kéken lássák, és fordítva, ha specek akkor szürkén látják.
  802.         {
  803.             case CS_TEAM_CT: iColor = -3; //kék
  804.                 case CS_TEAM_T: iColor = -2;//piros
  805.                 case CS_TEAM_SPECTATOR: iColor = -1;//szürke
  806.             }
  807.        
  808.         format(sDeath, charsmax(sDeath), is_user_alive(id) ? "":"*Halott*");
  809.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^1%s", sDeath);
  810.         #if defined RANK_ON
  811.         if(get_user_flags(id) & OWNER)
  812.             iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4Tulajdonos^3]^1");
  813.         else if(get_user_flags(id) & ADMIN)
  814.             iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4FőAdmin^3]^1");
  815.         else if(get_user_flags(id) & FOADMIN)
  816.             iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4Admin^3]^1");
  817.         else if(get_user_flags(id) & VIP)
  818.             iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4VIP^3]^1");
  819.         else
  820.             iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4Játékos^3]^1");
  821.        
  822.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4Szint: %d^3]", g_ePlayer[eLvl][id]);
  823.         #endif
  824.        
  825.         #if defined RANK_OFF
  826.         iLen += formatex(sText[iLen], charsmax(sText)-iLen, "^3[^4Szint: %d^3]", g_ePlayer[eLvl][id]);
  827.         #endif
  828.        
  829.         get_user_name(id, sName, charsmax(sName));
  830.         format(sMessage, charsmax(sMessage), "^1%s ^4%s ^3%s ^1%s", sText, sName, (get_user_flags(id) & ADMIN_KICK) ? "^4" : "^3", sMessage);
  831.        
  832.         for(new i; i < get_maxplayers(); i++)
  833.         {
  834.             if(!is_user_connected(i))
  835.                 continue;
  836.            
  837.             client_print_color(i, iColor, sMessage);
  838.         }
  839.         return PLUGIN_HANDLED_MAIN;
  840. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 21 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole