hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2022.09.28. 14:28



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 7 hozzászólás ] 
Szerző Üzenet
HozzászólásElküldve: 2022.09.16. 14:26 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 307
Megköszönt másnak: 61 alkalommal
Megköszönték neki: 8 alkalommal
Sziasztok!

Kérnék segítséget abban hogy Helytelen adatátvitel értéke mindig 0. Állítólag van rá megoldás és változóval ez megoldható! :)

Köszönöm előre is! :)

  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <cstrike>
  5. #include <sqlx>
  6.  
  7. #define PLUGIN "New Plug-In"
  8. #define VERSION "1.0"
  9. #define AUTHOR "author"
  10.  
  11. #define KILL_POINT 1
  12. #define HEADSHOT_POINT 5
  13. #define Tablename "Hlmodra_tabla_1" //SQL Tábla neve!//
  14.  
  15. enum _:GunDatas {
  16.     M4A1,
  17.     AK47,
  18.     AWP,
  19.     SCOUT,
  20.     FAMAS,
  21.     GALIL,
  22.     AUG,
  23.     M3,
  24.     XM1014,
  25.     KNIFE,
  26.     DEAGLE,
  27.     USP,
  28.     GLOCK
  29. }
  30. new g_SelectedGun[33][GunDatas], g_uPoints[33][GunDatas], g_Wpn[33];
  31. new sSteamID[64];
  32. new FunMentes[33];
  33.  
  34. new const gMenuPrefix[] = "\w[<<< Night~Warrior >>>]~\y»\yFun";
  35. new const gChatPrefix[] = "[<<< Night~Warrior >>>]"
  36.  
  37. enum _:DATA {
  38.     GunName[64],
  39.     ModelName[64],
  40.     Points[8]
  41. }
  42. new const WeaponM4A1[][DATA] = {
  43.     {"M4A1 | Default", "models/v_m4a1.mdl", 0, },
  44. }
  45. new const WeaponAK47[][DATA] = {
  46.     {"AK47 | Default", "models/v_ak47.mdl", 0, },
  47. }
  48. new const WeaponAWP[][DATA] = {
  49.     {"AWP | Default", "models/v_awp.mdl", 0, },
  50. }
  51. new const WeaponSCOUT[][DATA] = {
  52.     {"SCOUT | Default", "models/v_scout.mdl", 0, },
  53. }
  54. new const WeaponFAMAS[][DATA] = {
  55.     {"FAMAS | Default", "models/v_famas.mdl", 0, },
  56. }
  57. new const WeaponGALIL[][DATA] = {
  58.     {"GALIL | Default", "models/v_galil.mdl", 0, },
  59. }
  60. new const WeaponAUG[][DATA] = {
  61.     {"AUG | Default", "models/v_aug.mdl", 0, },
  62. }
  63. new const WeaponM3[][DATA] = {
  64.     {"M3 | Default", "models/v_m3.mdl", 0, },
  65. }
  66. new const WeaponXM1014[][DATA] = {
  67.     {"XM1014 | Default", "models/v_xm1014.mdl", 0, },
  68. }
  69. new const WeaponKNIFE[][DATA] = {
  70.     {"KNIFE | Default", "models/v_knife.mdl", 0, },
  71. }
  72. new const WeaponDEAGLE[][DATA] = {
  73.     {"DEAGLE | Default", "models/v_deagle.mdl", 0, },
  74. }
  75. new const WeaponUSP[][DATA] = {
  76.     {"USP | Default", "models/v_usp.mdl", 0, },
  77. }
  78. new const WeaponGLOCK[][DATA] = {
  79.     {"GLOCK18 | Default", "models/v_glock18.mdl", 0, },
  80. }  
  81. new const MainStrings[][] = {
  82.     "M4A1 Skinek",
  83.     "AK47 Skinek",
  84.     "AWP Skinek",
  85.     "SCOUT Skinek",
  86.     "FAMAS Skinek",
  87.     "GALIL Skinek",
  88.     "AUG Skinek",
  89.     "M3 Skinek",
  90.     "XM1014 Skinek",
  91.     "KNIFE Skinek",
  92.     "DEAGLE Skinek",
  93.     "USP Skinek",
  94.     "GLOCK18 Skinek"
  95. }
  96. public plugin_init() {
  97.     register_plugin(PLUGIN, VERSION, AUTHOR)
  98.     register_clcmd("say /menu", "openMainMenu")
  99.     register_clcmd("say /add", "Addolas")
  100.     register_impulse(201, "openMainMenu");
  101.     register_event("DeathMsg","Halal","a")
  102.     register_event("CurWeapon", "evChangeWeapon", "be", "1=1")
  103. }
  104. public Addolas(id)
  105. {
  106.     g_uPoints[id][M4A1] += 50
  107.     g_uPoints[id][AK47] += 50
  108.     g_uPoints[id][AWP] += 50
  109.     g_uPoints[id][SCOUT] += 50
  110.     g_uPoints[id][FAMAS] += 50
  111.     g_uPoints[id][GALIL] += 50
  112.     g_uPoints[id][AUG] += 50
  113.     g_uPoints[id][M3] += 50
  114.     g_uPoints[id][XM1014] += 50
  115.     g_uPoints[id][KNIFE] += 50
  116.     g_uPoints[id][DEAGLE] += 50
  117.     g_uPoints[id][USP] += 50
  118.     g_uPoints[id][GLOCK] += 50;
  119. }
  120. public plugin_precache() { 
  121.     for(new i;i < sizeof(WeaponM4A1); i++) precache_model(WeaponM4A1[i][ModelName])
  122.     for(new i;i < sizeof(WeaponAK47); i++) precache_model(WeaponAK47[i][ModelName])
  123.     for(new i;i < sizeof(WeaponAWP); i++) precache_model(WeaponAWP[i][ModelName])
  124.     for(new i;i < sizeof(WeaponSCOUT); i++) precache_model(WeaponSCOUT[i][ModelName])
  125.     for(new i;i < sizeof(WeaponFAMAS); i++) precache_model(WeaponFAMAS[i][ModelName])
  126.     for(new i;i < sizeof(WeaponGALIL); i++) precache_model(WeaponGALIL[i][ModelName])
  127.     for(new i;i < sizeof(WeaponAUG); i++) precache_model(WeaponAUG[i][ModelName])
  128.     for(new i;i < sizeof(WeaponM3); i++) precache_model(WeaponM3[i][ModelName])
  129.     for(new i;i < sizeof(WeaponXM1014); i++) precache_model(WeaponXM1014[i][ModelName])
  130.     for(new i;i < sizeof(WeaponKNIFE); i++) precache_model(WeaponKNIFE[i][ModelName])
  131.     for(new i;i < sizeof(WeaponDEAGLE); i++) precache_model(WeaponDEAGLE[i][ModelName])
  132.     for(new i;i < sizeof(WeaponUSP); i++) precache_model(WeaponUSP[i][ModelName])
  133.     for(new i;i < sizeof(WeaponGLOCK); i++) precache_model(WeaponGLOCK[i][ModelName])
  134. }
  135. public evChangeWeapon(id) {
  136.     switch(get_user_weapon(id)) {
  137.         case CSW_M4A1: entity_set_string(id, EV_SZ_viewmodel, WeaponM4A1[g_SelectedGun[id][M4A1]][ModelName]);
  138.             case CSW_AK47: entity_set_string(id, EV_SZ_viewmodel, WeaponAK47[g_SelectedGun[id][AK47]][ModelName]);
  139.             case CSW_AWP: entity_set_string(id, EV_SZ_viewmodel, WeaponAWP[g_SelectedGun[id][AWP]][ModelName]);
  140.             case CSW_SCOUT: entity_set_string(id, EV_SZ_viewmodel, WeaponSCOUT[g_SelectedGun[id][SCOUT]][ModelName]);
  141.             case CSW_FAMAS: entity_set_string(id, EV_SZ_viewmodel, WeaponFAMAS[g_SelectedGun[id][FAMAS]][ModelName]);
  142.             case CSW_GALIL: entity_set_string(id, EV_SZ_viewmodel, WeaponGALIL[g_SelectedGun[id][GALIL]][ModelName]);
  143.             case CSW_AUG: entity_set_string(id, EV_SZ_viewmodel, WeaponAUG[g_SelectedGun[id][AUG]][ModelName]);
  144.             case CSW_M3: entity_set_string(id, EV_SZ_viewmodel, WeaponM3[g_SelectedGun[id][M3]][ModelName]);
  145.             case CSW_XM1014: entity_set_string(id, EV_SZ_viewmodel, WeaponXM1014[g_SelectedGun[id][XM1014]][ModelName]);
  146.             case CSW_KNIFE: entity_set_string(id, EV_SZ_viewmodel, WeaponKNIFE[g_SelectedGun[id][KNIFE]][ModelName]);
  147.             case CSW_DEAGLE: entity_set_string(id, EV_SZ_viewmodel, WeaponDEAGLE[g_SelectedGun[id][DEAGLE]][ModelName]);
  148.             case CSW_USP: entity_set_string(id, EV_SZ_viewmodel, WeaponUSP[g_SelectedGun[id][USP]][ModelName]);
  149.             case CSW_GLOCK18: entity_set_string(id, EV_SZ_viewmodel, WeaponGLOCK[g_SelectedGun[id][GLOCK]][ModelName]);
  150.         }
  151.     return PLUGIN_CONTINUE
  152. }
  153. public Halal() {
  154.  
  155.     new iAttacker = read_data(1)
  156.     new iVictim = read_data(2)
  157.     new iHs = read_data(3)
  158.  
  159.     if(iAttacker == iVictim || iAttacker == 0) return PLUGIN_HANDLED
  160.     new iPoints = iHs ? HEADSHOT_POINT : KILL_POINT
  161.  
  162.     switch(get_user_weapon(iAttacker)) {
  163.         case CSW_M4A1: g_uPoints[iAttacker][M4A1] += iPoints
  164.             case CSW_AK47: g_uPoints[iAttacker][AK47] += iPoints
  165.             case CSW_AWP: g_uPoints[iAttacker][AWP] += iPoints
  166.             case CSW_SCOUT: g_uPoints[iAttacker][SCOUT] += iPoints
  167.             case CSW_FAMAS: g_uPoints[iAttacker][FAMAS] += iPoints
  168.             case CSW_GALIL: g_uPoints[iAttacker][GALIL] += iPoints
  169.             case CSW_AUG: g_uPoints[iAttacker][AUG] += iPoints
  170.             case CSW_M3: g_uPoints[iAttacker][M3] += iPoints
  171.             case CSW_XM1014: g_uPoints[iAttacker][XM1014] += iPoints
  172.             case CSW_KNIFE: g_uPoints[iAttacker][KNIFE] += iPoints
  173.             case CSW_DEAGLE: g_uPoints[iAttacker][DEAGLE] += iPoints
  174.             case CSW_USP: g_uPoints[iAttacker][USP] += iPoints
  175.             case CSW_GLOCK18: g_uPoints[iAttacker][GLOCK] += iPoints
  176.         }
  177.     set_hudmessage(random(256), random(256), random(256), -1.0, 0.20, 0, 6.0, 3.0);
  178.     show_hudmessage(iAttacker, "+%i Pont", iPoints);
  179.     return PLUGIN_CONTINUE;
  180. }
  181. public openMainMenu(id) {
  182.     new szMenu[121], String[6]
  183.     formatex(szMenu, charsmax(szMenu), "%s \wFőMenü", gChatPrefix);
  184.     new menu = menu_create(szMenu, "hMainMenu");
  185.  
  186.     for(new i ;i < sizeof(MainStrings); i++) {
  187.         num_to_str(i, String, 5)
  188.         formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  189.         menu_additem(menu, szMenu, String);
  190.     }
  191.     menu_display(id, menu, 0);
  192.     return PLUGIN_HANDLED;
  193. }
  194. public hMainMenu(id, menu, item) {
  195.     if(item == MENU_EXIT) {
  196.         menu_destroy(menu);
  197.         return PLUGIN_HANDLED;
  198.     }
  199.     g_Wpn[id] = item+1
  200.     openSkinMenu(id)
  201.     menu_destroy(menu);
  202.     return PLUGIN_HANDLED;
  203. }
  204. public openSkinMenu(id) {
  205.     new szMenu[121], szMenu2[64], String[6]
  206.     if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  207.     else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  208.         else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  209.         else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  210.         else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  211.         else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  212.         else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  213.         else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  214.         else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  215.         else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  216.         else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  217.         else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  218.         else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  219.         new menu = menu_create(szMenu, "hSkinChooser");
  220.     if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  221.     MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  222.     if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  223.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  224.     if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  225.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  226.     if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  227.     MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  228.     if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  229.     MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  230.     if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  231.     MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  232.     if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  233.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  234.     if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  235.     MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  236.     if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  237.     MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  238.     if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  239.     MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  240.     if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  241.     MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  242.     if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  243.     MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  244.     if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  245.     MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  246.  
  247.     if(g_Wpn[id] == 1) {
  248.         for(new i; i < sizeof(WeaponM4A1); i++) {
  249.             num_to_str(i, String, 5)
  250.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM4A1[i][Points]);
  251.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM4A1[i][GunName], g_SelectedGun[id][M4A1] == i ? "\y{Kiválasztva}": szMenu2);
  252.             menu_additem(menu, szMenu, String);
  253.         }
  254.     }
  255.     else if(g_Wpn[id] == 2) {
  256.         for(new i; i < sizeof(WeaponAK47); i++) {
  257.             num_to_str(i, String, 5)
  258.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAK47[i][Points]);
  259.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAK47[i][GunName], g_SelectedGun[id][AK47] == i ? "\y{Kiválasztva}": szMenu2);
  260.             menu_additem(menu, szMenu, String);
  261.         }
  262.     }
  263.     else if(g_Wpn[id] == 3) {
  264.         for(new i; i < sizeof(WeaponAWP); i++) {
  265.             num_to_str(i, String, 5)
  266.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAWP[i][Points]);
  267.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAWP[i][GunName], g_SelectedGun[id][AWP] == i ? "\y{Kiválasztva}": szMenu2);
  268.             menu_additem(menu, szMenu, String);
  269.         }
  270.     }
  271.     else if(g_Wpn[id] == 4) {
  272.         for(new i; i < sizeof(WeaponSCOUT); i++) {
  273.             num_to_str(i, String, 5)
  274.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponSCOUT[i][Points]);
  275.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponSCOUT[i][GunName], g_SelectedGun[id][SCOUT] == i ? "\y{Kiválasztva}": szMenu2);
  276.             menu_additem(menu, szMenu, String);
  277.         }
  278.     }
  279.     else if(g_Wpn[id] == 5) {
  280.         for(new i; i < sizeof(WeaponFAMAS); i++) {
  281.             num_to_str(i, String, 5)
  282.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponFAMAS[i][Points]);
  283.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponFAMAS[i][GunName], g_SelectedGun[id][FAMAS] == i ? "\y{Kiválasztva}": szMenu2);
  284.             menu_additem(menu, szMenu, String);
  285.         }
  286.     }
  287.     else if(g_Wpn[id] == 6) {
  288.         for(new i; i < sizeof(WeaponGALIL); i++) {
  289.             num_to_str(i, String, 5)
  290.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGALIL[i][Points]);
  291.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGALIL[i][GunName], g_SelectedGun[id][GALIL] == i ? "\y{Kiválasztva}": szMenu2);
  292.             menu_additem(menu, szMenu, String);
  293.         }
  294.     }
  295.     else if(g_Wpn[id] == 7) {
  296.         for(new i; i < sizeof(WeaponAUG); i++) {
  297.             num_to_str(i, String, 5)
  298.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAUG[i][Points]);
  299.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAUG[i][GunName], g_SelectedGun[id][AUG] == i ? "\y{Kiválasztva}": szMenu2);
  300.             menu_additem(menu, szMenu, String);
  301.         }
  302.     }
  303.     else if(g_Wpn[id] == 8) {
  304.         for(new i; i < sizeof(WeaponM3); i++) {
  305.             num_to_str(i, String, 5)
  306.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM3[i][Points]);
  307.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM3[i][GunName], g_SelectedGun[id][M3] == i ? "\y{Kiválasztva}": szMenu2);
  308.             menu_additem(menu, szMenu, String);
  309.         }
  310.     }
  311.     else if(g_Wpn[id] == 9) {
  312.         for(new i; i < sizeof(WeaponXM1014); i++) {
  313.             num_to_str(i, String, 5)
  314.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponXM1014[i][Points]);
  315.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponXM1014[i][GunName], g_SelectedGun[id][XM1014] == i ? "\y{Kiválasztva}": szMenu2);
  316.             menu_additem(menu, szMenu, String);
  317.         }
  318.     }
  319.     else if(g_Wpn[id] == 10) {
  320.         for(new i; i < sizeof(WeaponKNIFE); i++) {
  321.             num_to_str(i, String, 5)
  322.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponKNIFE[i][Points]);
  323.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponKNIFE[i][GunName], g_SelectedGun[id][KNIFE] == i ? "\y{Kiválasztva}": szMenu2);
  324.             menu_additem(menu, szMenu, String);
  325.         }
  326.     }
  327.     else if(g_Wpn[id] == 11) {
  328.         for(new i; i < sizeof(WeaponDEAGLE); i++) {
  329.             num_to_str(i, String, 5)
  330.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponDEAGLE[i][Points]);
  331.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponDEAGLE[i][GunName], g_SelectedGun[id][DEAGLE] == i ? "\y{Kiválasztva}": szMenu2);
  332.             menu_additem(menu, szMenu, String);
  333.         }
  334.     }
  335.     else if(g_Wpn[id] == 12) {
  336.         for(new i; i < sizeof(WeaponUSP); i++) {
  337.             num_to_str(i, String, 5)
  338.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponUSP[i][Points]);
  339.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponUSP[i][GunName], g_SelectedGun[id][USP] == i ? "\y{Kiválasztva}": szMenu2);
  340.             menu_additem(menu, szMenu, String);
  341.         }
  342.     }
  343.     else if(g_Wpn[id] == 13) {
  344.         for(new i; i < sizeof(WeaponGLOCK); i++) {
  345.             num_to_str(i, String, 5)
  346.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGLOCK[i][Points]);
  347.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGLOCK[i][GunName], g_SelectedGun[id][GLOCK] == i ? "\y{Kiválasztva}": szMenu2);
  348.             menu_additem(menu, szMenu, String);
  349.         }
  350.     }
  351.     menu_display(id, menu, 0);
  352.     return PLUGIN_HANDLED;
  353. }
  354. public hSkinChooser(id, menu, item) {
  355.     if(item == MENU_EXIT)
  356.     {
  357.         menu_destroy(menu);
  358.         return PLUGIN_CONTINUE;
  359.     }
  360.     switch(g_Wpn[id]) {
  361.         case 1: {
  362.             if(g_uPoints[id][M4A1] >= WeaponM4A1[item][Points]) {
  363.                 g_SelectedGun[id][M4A1] = item
  364.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  365.             }
  366.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  367.         }
  368.         case 2: {
  369.             if(g_uPoints[id][AK47] >= WeaponAK47[item][Points]) {
  370.                 g_SelectedGun[id][AK47] = item
  371.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  372.             }
  373.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  374.         }
  375.         case 3: {
  376.             if(g_uPoints[id][AWP] >= WeaponAWP[item][Points]) {
  377.                 g_SelectedGun[id][AWP] = item
  378.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  379.             }
  380.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  381.         }
  382.         case 4: {
  383.             if(g_uPoints[id][SCOUT] >= WeaponSCOUT[item][Points]) {
  384.                 g_SelectedGun[id][SCOUT] = item
  385.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  386.             }
  387.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  388.         }
  389.         case 5: {
  390.             if(g_uPoints[id][FAMAS] >= WeaponFAMAS[item][Points]) {
  391.                 g_SelectedGun[id][FAMAS] = item
  392.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  393.             }
  394.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  395.         }
  396.         case 6: {
  397.             if(g_uPoints[id][GALIL] >= WeaponGALIL[item][Points]) {
  398.                 g_SelectedGun[id][GALIL] = item
  399.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  400.             }
  401.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  402.         }
  403.         case 7: {
  404.             if(g_uPoints[id][AUG] >= WeaponAUG[item][Points]) {
  405.                 g_SelectedGun[id][AUG] = item
  406.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  407.             }
  408.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  409.         }
  410.         case 8: {
  411.             if(g_uPoints[id][M3] >= WeaponM3[item][Points]) {
  412.                 g_SelectedGun[id][M3] = item
  413.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  414.             }
  415.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  416.         }
  417.         case 9: {
  418.             if(g_uPoints[id][XM1014] >= WeaponXM1014[item][Points]) {
  419.                 g_SelectedGun[id][XM1014] = item
  420.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  421.             }
  422.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  423.         }
  424.         case 10: {
  425.             if(g_uPoints[id][KNIFE] >= WeaponKNIFE[item][Points]) {
  426.                 g_SelectedGun[id][KNIFE] = item
  427.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  428.             }
  429.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  430.         }
  431.         case 11: {
  432.             if(g_uPoints[id][DEAGLE] >= WeaponDEAGLE[item][Points]) {
  433.                 g_SelectedGun[id][DEAGLE] = item
  434.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  435.             }
  436.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  437.         }
  438.         case 12: {
  439.             if(g_uPoints[id][USP] >= WeaponUSP[item][Points]) {
  440.                 g_SelectedGun[id][USP] = item
  441.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  442.             }
  443.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  444.         }
  445.         case 13: {
  446.             if(g_uPoints[id][GLOCK] >= WeaponGLOCK[item][Points]) {
  447.                 g_SelectedGun[id][GLOCK] = item
  448.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  449.             }
  450.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  451.         }
  452.     }
  453.     menu_destroy(menu);
  454.     return PLUGIN_HANDLED;
  455. }
  456. public client_putinserver(id)
  457. {
  458.     if(is_user_bot(id))
  459.         return;
  460.  
  461.     FunMentes[id] = 1;
  462.     g_uPoints[id][M4A1] = 0;
  463.     g_uPoints[id][AK47] = 0;
  464.     g_uPoints[id][AWP] = 0;
  465.     g_uPoints[id][SCOUT] = 0;
  466.     g_uPoints[id][FAMAS] = 0;
  467.     g_uPoints[id][GALIL] = 0;
  468.     g_uPoints[id][AUG] = 0;
  469.     g_uPoints[id][M3] = 0;
  470.     g_uPoints[id][XM1014] = 0;
  471.     g_uPoints[id][KNIFE] = 0;
  472.     g_uPoints[id][DEAGLE] = 0;
  473.     g_uPoints[id][USP] = 0;
  474.     g_uPoints[id][GLOCK] = 0;
  475.     g_SelectedGun[id][M4A1] = 0;
  476.     g_SelectedGun[id][AK47] = 0;
  477.     g_SelectedGun[id][AWP] = 0;
  478.     g_SelectedGun[id][SCOUT] = 0;
  479.     g_SelectedGun[id][FAMAS] = 0;
  480.     g_SelectedGun[id][GALIL] = 0;
  481.     g_SelectedGun[id][AUG] = 0;
  482.     g_SelectedGun[id][M3] = 0;
  483.     g_SelectedGun[id][XM1014] = 0;
  484.     g_SelectedGun[id][KNIFE] = 0;
  485.     g_SelectedGun[id][DEAGLE] = 0;
  486.     g_SelectedGun[id][USP] = 0;
  487.     g_SelectedGun[id][GLOCK] = 0;
  488.  
  489.     SelectDataTable(id);
  490. }
  491. public client_disconnected(id)
  492. {
  493.     if(is_user_bot(id))
  494.         return;
  495.  
  496.     FunMentes[id] = 0;
  497.     TableUpdate(id);
  498. }
  499. new Handle:g_SqlTuple;
  500. public plugin_cfg()
  501. {
  502.     //Kiszolgáló | Felhasználó | Jelszó | Adatbázis
  503.  
  504.     g_SqlTuple = SQL_MakeDbTuple("maria.srkhost.eu", "", "", "");
  505.     CreateTable();
  506. }
  507. public CreateTable(){
  508.     new iLen;
  509.     static sQuery[10048];
  510.  
  511.     iLen += formatex(sQuery[iLen], charsmax(sQuery), "CREATE TABLE IF NOT EXISTS `%s` ", Tablename);
  512.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "( ");
  513.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`Id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,");
  514.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`SteamId` varchar(64) NOT NULL,");
  515.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM4A1` int(11) NOT NULL,");
  516.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAK47` int(11) NOT NULL,");
  517.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAWP` int(11) NOT NULL,");
  518.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsSCOUT` int(11) NOT NULL,");
  519.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsFAMAS` int(11) NOT NULL,");
  520.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGALIL` int(11) NOT NULL,");
  521.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAUG` int(11) NOT NULL,");
  522.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM3` int(11) NOT NULL,");
  523.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsXM1014` int(11) NOT NULL,");
  524.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsKNIFE` int(11) NOT NULL,");
  525.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsDEAGLE` int(11) NOT NULL,");
  526.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsUSP` int(11) NOT NULL,");
  527.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGLOCK` int(11) NOT NULL,");
  528.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM4A1` int(11) NOT NULL,");
  529.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAK47` int(11) NOT NULL,");
  530.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAWP` int(11) NOT NULL,");
  531.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunSCOUT` int(11) NOT NULL,");
  532.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunFAMAS` int(11) NOT NULL,");
  533.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGALIL` int(11) NOT NULL,");
  534.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAUG` int(11) NOT NULL,");
  535.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM3` int(11) NOT NULL,");
  536.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunXM1014` int(11) NOT NULL,");
  537.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunKNIFE` int(11) NOT NULL,");
  538.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunDEAGLE` int(11) NOT NULL,");
  539.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunUSP` int(11) NOT NULL,");
  540.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGLOCK` int(11) NOT NULL)");
  541.  
  542.     SQL_ThreadQuery(g_SqlTuple, "TableCreateThread", sQuery);
  543. }
  544. public TableUpdate(id)
  545. {
  546.     static sQuery[10048];
  547.     new iLen, sSteamID[64];
  548.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  549.  
  550.     iLen += formatex(sQuery[iLen], charsmax(sQuery), "UPDATE `%s` SET ", Tablename);
  551.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM4A1 = ^"%i^",", g_uPoints[id][M4A1]);
  552.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAK47 = ^"%i^",", g_uPoints[id][AK47]);
  553.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAWP = ^"%i^",", g_uPoints[id][AWP]);
  554.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsSCOUT = ^"%i^",", g_uPoints[id][SCOUT]);
  555.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsFAMAS = ^"%i^",", g_uPoints[id][FAMAS]);
  556.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGALIL = ^"%i^",", g_uPoints[id][GALIL]);
  557.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAUG = ^"%i^",", g_uPoints[id][AUG]);
  558.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM3 = ^"%i^",", g_uPoints[id][M3]);
  559.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsXM1014 = ^"%i^",", g_uPoints[id][XM1014]);
  560.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsKNIFE = ^"%i^",", g_uPoints[id][KNIFE]);
  561.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsDEAGLE = ^"%i^",", g_uPoints[id][DEAGLE]);
  562.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsUSP = ^"%i^",", g_uPoints[id][USP]);
  563.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGLOCK = ^"%i^",", g_uPoints[id][GLOCK]);
  564.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAK47 = ^"%i^",", g_SelectedGun[id][AK47]);
  565.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAWP = ^"%i^",", g_SelectedGun[id][AWP]);
  566.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunSCOUT = ^"%i^",", g_SelectedGun[id][SCOUT]);
  567.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunFAMAS = ^"%i^",", g_SelectedGun[id][FAMAS]);
  568.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGALIL = ^"%i^",", g_SelectedGun[id][GALIL]);
  569.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAUG = ^"%i^",", g_SelectedGun[id][AUG]);
  570.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM3 = ^"%i^",", g_SelectedGun[id][M3]);
  571.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunXM1014 = ^"%i^",", g_SelectedGun[id][XM1014]);
  572.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunKNIFE = ^"%i^",", g_SelectedGun[id][KNIFE]);
  573.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunDEAGLE = ^"%i^",", g_SelectedGun[id][DEAGLE]);
  574.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunUSP = ^"%i^",", g_SelectedGun[id][USP]);
  575.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGLOCK = ^"%i^",", g_SelectedGun[id][GLOCK]);
  576.  
  577.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM4A1 = ^"%i^" WHERE `SteamId` = ^"%s^";", g_SelectedGun[id][M4A1], sSteamID);
  578.     SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  579. }
  580. public TableCreateThread(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  581. {
  582.     if(iFailState == TQUERY_CONNECT_FAILED)
  583.         set_fail_state("[Create] Nem lehet csatlakozni az adatbazishoz!");
  584.     else if(iFailState == TQUERY_QUERY_FAILED)
  585.         set_fail_state("[Create] Lekerdezesi hiba");
  586.     if(iErrcode)
  587.         log_amx("[Create] Hiba:**!! %s !!**", sError);
  588. }
  589. public TableInsert(id)
  590. {
  591.     static sQuery[10048], sSteamID[64];
  592.  
  593.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  594.     formatex(sQuery, charsmax(sQuery), "INSERT INTO `%s` (`SteamId`) VALUES (^"%s^");", Tablename, sSteamID);
  595.     SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  596. }
  597. public SelectDataTable(id)
  598. {
  599.     static sQuery[10048];
  600.     new sData[1], sSteamID[64];
  601.     sData[0] = id;
  602.  
  603.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  604.  
  605.     formatex(sQuery, charsmax(sQuery), "SELECT * FROM `%s` WHERE SteamId = ^"%s^";", Tablename, sSteamID);
  606.     SQL_ThreadQuery(g_SqlTuple, "QuerySelectDataTable", sQuery, sData, 2);
  607. }
  608. public QuerySelectDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  609. {
  610.     if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  611.     {
  612.         log_amx("[Insert] Hiba:**!! %s !!**", sError);
  613.         return;
  614.     }
  615.     else
  616.     {
  617.         new id = sData[0];
  618.  
  619.         if(SQL_NumRows(sQuery) > 0)
  620.         {
  621.             g_uPoints[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM4A1"));
  622.             g_uPoints[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAK47"));
  623.             g_uPoints[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAWP"));
  624.             g_uPoints[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsSCOUT"));
  625.             g_uPoints[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsFAMAS"));
  626.             g_uPoints[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGALIL"));
  627.             g_uPoints[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAUG"));
  628.             g_uPoints[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM3"));
  629.             g_uPoints[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsXM1014"));
  630.             g_uPoints[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsKNIFE"));
  631.             g_uPoints[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsDEAGLE"));
  632.             g_uPoints[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsUSP"));
  633.             g_uPoints[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGLOCK"));
  634.             g_SelectedGun[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM4A1"));
  635.             g_SelectedGun[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAK47"));
  636.             g_SelectedGun[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAWP"));
  637.             g_SelectedGun[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunSCOUT"));
  638.             g_SelectedGun[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunFAMAS"));
  639.             g_SelectedGun[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGALIL"));
  640.             g_SelectedGun[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAUG"));
  641.             g_SelectedGun[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM3"));
  642.             g_SelectedGun[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunXM1014"));
  643.             g_SelectedGun[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunKNIFE"));
  644.             g_SelectedGun[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunDEAGLE"));
  645.             g_SelectedGun[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunUSP"));
  646.             g_SelectedGun[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGLOCK"));
  647.         }
  648.         else
  649.             TableInsert(id);
  650.     }
  651. }
  652. public QuerySetDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  653. {
  654.     if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  655.     {
  656.         log_amx("[SetData] Hiba:**!! %s !!**", sError);
  657.         return;
  658.     }
  659. }


A hozzászólást 2 alkalommal szerkesztették, utoljára saxxo 2022.09.26. 16:31-kor.

Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.17. 15:20 
Offline
Senior Tag
Avatar

Csatlakozott: 2017.08.09. 17:01
Hozzászólások: 261
Megköszönt másnak: 60 alkalommal
Megköszönték neki: 70 alkalommal
Wha..? :?:
Milyen adatot akarsz átvinni, és hova, milyen formában, azt is jó lenne tudni.
Ez esetleg egy hiba? Ha igen egy logot miért nem lehet csatolni?
Így hogy ki kell húzni belőled a hibát is amit szeretnél, hogy helyetted oldjanak meg minden alkalommal, senki nem fog segíteni.
Csak egy apró tipp :roll:

_________________
"Szeretek aludni... mert az álmaim szebbek, mint a valóság."

Ők köszönték meg HellEnergY nek ezt a hozzászólást: saxxo (2022.09.20. 06:34)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.17. 15:26 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 307
Megköszönt másnak: 61 alkalommal
Megköszönték neki: 8 alkalommal
HellEnergY írta:
Wha..? :?:
Milyen adatot akarsz átvinni, és hova, milyen formában, azt is jó lenne tudni.
Ez esetleg egy hiba? Ha igen egy logot miért nem lehet csatolni?
Így hogy ki kell húzni belőled a hibát is amit szeretnél, hogy helyetted oldjanak meg minden alkalommal, senki nem fog segíteni.
Csak egy apró tipp :roll:



Szia!
A mentett dolgokat sokszor nem tudja betölteni és nem tudja tovább vinni így sokszor a mentett dolgok 0, lesz! :)


logfájt nem tudok küldeni sajnos!


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.17. 16:24 
Offline
Félisten
Avatar

Csatlakozott: 2016.03.06. 14:20
Hozzászólások: 954
Megköszönt másnak: 94 alkalommal
Megköszönték neki: 132 alkalommal
Szerintem nem ártana ha néha frissítenéd ezt a public ot : TableUpdate(id);

Mert most csak lecsatlakozáskor frissít... próbáld meg hogy pl, X másodpercenként vagy X percenként vagy ölésenként...

Vagy próbáld meg így is:


  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <cstrike>
  5. #include <sqlx>
  6.  
  7. #define PLUGIN "New Plug-In"
  8. #define VERSION "1.0"
  9. #define AUTHOR "author"
  10.  
  11. #define KILL_POINT 1
  12. #define HEADSHOT_POINT 5
  13. #define Tablename "Hlmodra_tabla_1" //SQL Tábla neve!//
  14.  
  15. enum _:GunDatas {
  16.     M4A1,
  17.     AK47,
  18.     AWP,
  19.     SCOUT,
  20.     FAMAS,
  21.     GALIL,
  22.     AUG,
  23.     M3,
  24.     XM1014,
  25.     KNIFE,
  26.     DEAGLE,
  27.     USP,
  28.     GLOCK
  29. }
  30. new g_SelectedGun[33][GunDatas], g_uPoints[33][GunDatas], g_Wpn[33];
  31. new sSteamID[64];
  32. new FunMentes[33];
  33.  
  34. new const gMenuPrefix[] = "\w[<<< Night~Warrior >>>]~\y»\yFun";
  35. new const gChatPrefix[] = "[<<< Night~Warrior >>>]"
  36.  
  37. enum _:DATA {
  38.     GunName[64],
  39.     ModelName[64],
  40.     Points[8]
  41. }
  42. new const WeaponM4A1[][DATA] = {
  43.     {"M4A1 | Default", "models/v_m4a1.mdl", 0, },
  44. }
  45. new const WeaponAK47[][DATA] = {
  46.     {"AK47 | Default", "models/v_ak47.mdl", 0, },
  47. }
  48. new const WeaponAWP[][DATA] = {
  49.     {"AWP | Default", "models/v_awp.mdl", 0, },
  50. }
  51. new const WeaponSCOUT[][DATA] = {
  52.     {"SCOUT | Default", "models/v_scout.mdl", 0, },
  53. }
  54. new const WeaponFAMAS[][DATA] = {
  55.     {"FAMAS | Default", "models/v_famas.mdl", 0, },
  56. }
  57. new const WeaponGALIL[][DATA] = {
  58.     {"GALIL | Default", "models/v_galil.mdl", 0, },
  59. }
  60. new const WeaponAUG[][DATA] = {
  61.     {"AUG | Default", "models/v_aug.mdl", 0, },
  62. }
  63. new const WeaponM3[][DATA] = {
  64.     {"M3 | Default", "models/v_m3.mdl", 0, },
  65. }
  66. new const WeaponXM1014[][DATA] = {
  67.     {"XM1014 | Default", "models/v_xm1014.mdl", 0, },
  68. }
  69. new const WeaponKNIFE[][DATA] = {
  70.     {"KNIFE | Default", "models/v_knife.mdl", 0, },
  71. }
  72. new const WeaponDEAGLE[][DATA] = {
  73.     {"DEAGLE | Default", "models/v_deagle.mdl", 0, },
  74. }
  75. new const WeaponUSP[][DATA] = {
  76.     {"USP | Default", "models/v_usp.mdl", 0, },
  77. }
  78. new const WeaponGLOCK[][DATA] = {
  79.     {"GLOCK18 | Default", "models/v_glock18.mdl", 0, },
  80. }  
  81. new const MainStrings[][] = {
  82.     "M4A1 Skinek",
  83.     "AK47 Skinek",
  84.     "AWP Skinek",
  85.     "SCOUT Skinek",
  86.     "FAMAS Skinek",
  87.     "GALIL Skinek",
  88.     "AUG Skinek",
  89.     "M3 Skinek",
  90.     "XM1014 Skinek",
  91.     "KNIFE Skinek",
  92.     "DEAGLE Skinek",
  93.     "USP Skinek",
  94.     "GLOCK18 Skinek"
  95. }
  96. public plugin_init() {
  97.     register_plugin(PLUGIN, VERSION, AUTHOR)
  98.     register_clcmd("say /menu", "openMainMenu")
  99.     register_clcmd("say /add", "Addolas")
  100.    
  101.     register_impulse(201, "openMainMenu");
  102.    
  103.     register_event("DeathMsg","Halal","a")
  104.     register_event("CurWeapon", "evChangeWeapon", "be", "1=1")
  105.    
  106.     set_task(15.0,"autoSave",.flags="b")
  107. }
  108. public Addolas(id)
  109. {
  110.     g_uPoints[id][M4A1] += 50
  111.     g_uPoints[id][AK47] += 50
  112.     g_uPoints[id][AWP] += 50
  113.     g_uPoints[id][SCOUT] += 50
  114.     g_uPoints[id][FAMAS] += 50
  115.     g_uPoints[id][GALIL] += 50
  116.     g_uPoints[id][AUG] += 50
  117.     g_uPoints[id][M3] += 50
  118.     g_uPoints[id][XM1014] += 50
  119.     g_uPoints[id][KNIFE] += 50
  120.     g_uPoints[id][DEAGLE] += 50
  121.     g_uPoints[id][USP] += 50
  122.     g_uPoints[id][GLOCK] += 50;
  123. }
  124. public plugin_precache() {
  125.     for(new i;i < sizeof(WeaponM4A1); i++) precache_model(WeaponM4A1[i][ModelName])
  126.     for(new i;i < sizeof(WeaponAK47); i++) precache_model(WeaponAK47[i][ModelName])
  127.     for(new i;i < sizeof(WeaponAWP); i++) precache_model(WeaponAWP[i][ModelName])
  128.     for(new i;i < sizeof(WeaponSCOUT); i++) precache_model(WeaponSCOUT[i][ModelName])
  129.     for(new i;i < sizeof(WeaponFAMAS); i++) precache_model(WeaponFAMAS[i][ModelName])
  130.     for(new i;i < sizeof(WeaponGALIL); i++) precache_model(WeaponGALIL[i][ModelName])
  131.     for(new i;i < sizeof(WeaponAUG); i++) precache_model(WeaponAUG[i][ModelName])
  132.     for(new i;i < sizeof(WeaponM3); i++) precache_model(WeaponM3[i][ModelName])
  133.     for(new i;i < sizeof(WeaponXM1014); i++) precache_model(WeaponXM1014[i][ModelName])
  134.     for(new i;i < sizeof(WeaponKNIFE); i++) precache_model(WeaponKNIFE[i][ModelName])
  135.     for(new i;i < sizeof(WeaponDEAGLE); i++) precache_model(WeaponDEAGLE[i][ModelName])
  136.     for(new i;i < sizeof(WeaponUSP); i++) precache_model(WeaponUSP[i][ModelName])
  137.     for(new i;i < sizeof(WeaponGLOCK); i++) precache_model(WeaponGLOCK[i][ModelName])
  138. }
  139. public evChangeWeapon(id) {
  140.     switch(get_user_weapon(id)) {
  141.         case CSW_M4A1: entity_set_string(id, EV_SZ_viewmodel, WeaponM4A1[g_SelectedGun[id][M4A1]][ModelName]);
  142.             case CSW_AK47: entity_set_string(id, EV_SZ_viewmodel, WeaponAK47[g_SelectedGun[id][AK47]][ModelName]);
  143.             case CSW_AWP: entity_set_string(id, EV_SZ_viewmodel, WeaponAWP[g_SelectedGun[id][AWP]][ModelName]);
  144.             case CSW_SCOUT: entity_set_string(id, EV_SZ_viewmodel, WeaponSCOUT[g_SelectedGun[id][SCOUT]][ModelName]);
  145.             case CSW_FAMAS: entity_set_string(id, EV_SZ_viewmodel, WeaponFAMAS[g_SelectedGun[id][FAMAS]][ModelName]);
  146.             case CSW_GALIL: entity_set_string(id, EV_SZ_viewmodel, WeaponGALIL[g_SelectedGun[id][GALIL]][ModelName]);
  147.             case CSW_AUG: entity_set_string(id, EV_SZ_viewmodel, WeaponAUG[g_SelectedGun[id][AUG]][ModelName]);
  148.             case CSW_M3: entity_set_string(id, EV_SZ_viewmodel, WeaponM3[g_SelectedGun[id][M3]][ModelName]);
  149.             case CSW_XM1014: entity_set_string(id, EV_SZ_viewmodel, WeaponXM1014[g_SelectedGun[id][XM1014]][ModelName]);
  150.             case CSW_KNIFE: entity_set_string(id, EV_SZ_viewmodel, WeaponKNIFE[g_SelectedGun[id][KNIFE]][ModelName]);
  151.             case CSW_DEAGLE: entity_set_string(id, EV_SZ_viewmodel, WeaponDEAGLE[g_SelectedGun[id][DEAGLE]][ModelName]);
  152.             case CSW_USP: entity_set_string(id, EV_SZ_viewmodel, WeaponUSP[g_SelectedGun[id][USP]][ModelName]);
  153.             case CSW_GLOCK18: entity_set_string(id, EV_SZ_viewmodel, WeaponGLOCK[g_SelectedGun[id][GLOCK]][ModelName]);
  154.         }
  155.     return PLUGIN_CONTINUE
  156. }
  157. public Halal() {
  158.    
  159.     new iAttacker = read_data(1)
  160.     new iVictim = read_data(2)
  161.     new iHs = read_data(3)
  162.    
  163.     if(iAttacker == iVictim || iAttacker == 0) return PLUGIN_HANDLED
  164.     new iPoints = iHs ? HEADSHOT_POINT : KILL_POINT
  165.    
  166.     switch(get_user_weapon(iAttacker)) {
  167.         case CSW_M4A1: g_uPoints[iAttacker][M4A1] += iPoints
  168.             case CSW_AK47: g_uPoints[iAttacker][AK47] += iPoints
  169.             case CSW_AWP: g_uPoints[iAttacker][AWP] += iPoints
  170.             case CSW_SCOUT: g_uPoints[iAttacker][SCOUT] += iPoints
  171.             case CSW_FAMAS: g_uPoints[iAttacker][FAMAS] += iPoints
  172.             case CSW_GALIL: g_uPoints[iAttacker][GALIL] += iPoints
  173.             case CSW_AUG: g_uPoints[iAttacker][AUG] += iPoints
  174.             case CSW_M3: g_uPoints[iAttacker][M3] += iPoints
  175.             case CSW_XM1014: g_uPoints[iAttacker][XM1014] += iPoints
  176.             case CSW_KNIFE: g_uPoints[iAttacker][KNIFE] += iPoints
  177.             case CSW_DEAGLE: g_uPoints[iAttacker][DEAGLE] += iPoints
  178.             case CSW_USP: g_uPoints[iAttacker][USP] += iPoints
  179.             case CSW_GLOCK18: g_uPoints[iAttacker][GLOCK] += iPoints
  180.         }
  181.     set_hudmessage(random(256), random(256), random(256), -1.0, 0.20, 0, 6.0, 3.0);
  182.     show_hudmessage(iAttacker, "+%i Pont", iPoints);
  183.     return PLUGIN_CONTINUE;
  184. }
  185. public openMainMenu(id) {
  186.     new szMenu[121], String[6]
  187.     formatex(szMenu, charsmax(szMenu), "%s \wFőMenü", gChatPrefix);
  188.     new menu = menu_create(szMenu, "hMainMenu");
  189.    
  190.     for(new i ;i < sizeof(MainStrings); i++) {
  191.         num_to_str(i, String, 5)
  192.         formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  193.         menu_additem(menu, szMenu, String);
  194.     }
  195.     menu_display(id, menu, 0);
  196.     return PLUGIN_HANDLED;
  197. }
  198. public hMainMenu(id, menu, item) {
  199.     if(item == MENU_EXIT) {
  200.         menu_destroy(menu);
  201.         return PLUGIN_HANDLED;
  202.     }
  203.     g_Wpn[id] = item+1
  204.     openSkinMenu(id)
  205.     menu_destroy(menu);
  206.     return PLUGIN_HANDLED;
  207. }
  208. public openSkinMenu(id) {
  209.     new szMenu[121], szMenu2[64], String[6]
  210.     if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  211.     else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  212.         else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  213.         else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  214.         else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  215.         else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  216.         else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  217.         else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  218.         else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  219.         else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  220.         else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  221.         else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  222.         else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  223.     new menu = menu_create(szMenu, "hSkinChooser");
  224.     if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  225.     MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  226.     if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  227.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  228.     if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  229.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  230.     if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  231.     MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  232.     if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  233.     MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  234.     if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  235.     MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  236.     if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  237.     MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  238.     if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  239.     MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  240.     if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  241.     MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  242.     if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  243.     MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  244.     if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  245.     MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  246.     if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  247.     MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  248.     if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  249.     MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  250.    
  251.     if(g_Wpn[id] == 1) {
  252.         for(new i; i < sizeof(WeaponM4A1); i++) {
  253.             num_to_str(i, String, 5)
  254.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM4A1[i][Points]);
  255.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM4A1[i][GunName], g_SelectedGun[id][M4A1] == i ? "\y{Kiválasztva}": szMenu2);
  256.             menu_additem(menu, szMenu, String);
  257.         }
  258.     }
  259.     else if(g_Wpn[id] == 2) {
  260.         for(new i; i < sizeof(WeaponAK47); i++) {
  261.             num_to_str(i, String, 5)
  262.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAK47[i][Points]);
  263.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAK47[i][GunName], g_SelectedGun[id][AK47] == i ? "\y{Kiválasztva}": szMenu2);
  264.             menu_additem(menu, szMenu, String);
  265.         }
  266.     }
  267.     else if(g_Wpn[id] == 3) {
  268.         for(new i; i < sizeof(WeaponAWP); i++) {
  269.             num_to_str(i, String, 5)
  270.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAWP[i][Points]);
  271.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAWP[i][GunName], g_SelectedGun[id][AWP] == i ? "\y{Kiválasztva}": szMenu2);
  272.             menu_additem(menu, szMenu, String);
  273.         }
  274.     }
  275.     else if(g_Wpn[id] == 4) {
  276.         for(new i; i < sizeof(WeaponSCOUT); i++) {
  277.             num_to_str(i, String, 5)
  278.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponSCOUT[i][Points]);
  279.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponSCOUT[i][GunName], g_SelectedGun[id][SCOUT] == i ? "\y{Kiválasztva}": szMenu2);
  280.             menu_additem(menu, szMenu, String);
  281.         }
  282.     }
  283.     else if(g_Wpn[id] == 5) {
  284.         for(new i; i < sizeof(WeaponFAMAS); i++) {
  285.             num_to_str(i, String, 5)
  286.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponFAMAS[i][Points]);
  287.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponFAMAS[i][GunName], g_SelectedGun[id][FAMAS] == i ? "\y{Kiválasztva}": szMenu2);
  288.             menu_additem(menu, szMenu, String);
  289.         }
  290.     }
  291.     else if(g_Wpn[id] == 6) {
  292.         for(new i; i < sizeof(WeaponGALIL); i++) {
  293.             num_to_str(i, String, 5)
  294.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGALIL[i][Points]);
  295.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGALIL[i][GunName], g_SelectedGun[id][GALIL] == i ? "\y{Kiválasztva}": szMenu2);
  296.             menu_additem(menu, szMenu, String);
  297.         }
  298.     }
  299.     else if(g_Wpn[id] == 7) {
  300.         for(new i; i < sizeof(WeaponAUG); i++) {
  301.             num_to_str(i, String, 5)
  302.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAUG[i][Points]);
  303.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAUG[i][GunName], g_SelectedGun[id][AUG] == i ? "\y{Kiválasztva}": szMenu2);
  304.             menu_additem(menu, szMenu, String);
  305.         }
  306.     }
  307.     else if(g_Wpn[id] == 8) {
  308.         for(new i; i < sizeof(WeaponM3); i++) {
  309.             num_to_str(i, String, 5)
  310.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM3[i][Points]);
  311.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM3[i][GunName], g_SelectedGun[id][M3] == i ? "\y{Kiválasztva}": szMenu2);
  312.             menu_additem(menu, szMenu, String);
  313.         }
  314.     }
  315.     else if(g_Wpn[id] == 9) {
  316.         for(new i; i < sizeof(WeaponXM1014); i++) {
  317.             num_to_str(i, String, 5)
  318.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponXM1014[i][Points]);
  319.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponXM1014[i][GunName], g_SelectedGun[id][XM1014] == i ? "\y{Kiválasztva}": szMenu2);
  320.             menu_additem(menu, szMenu, String);
  321.         }
  322.     }
  323.     else if(g_Wpn[id] == 10) {
  324.         for(new i; i < sizeof(WeaponKNIFE); i++) {
  325.             num_to_str(i, String, 5)
  326.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponKNIFE[i][Points]);
  327.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponKNIFE[i][GunName], g_SelectedGun[id][KNIFE] == i ? "\y{Kiválasztva}": szMenu2);
  328.             menu_additem(menu, szMenu, String);
  329.         }
  330.     }
  331.     else if(g_Wpn[id] == 11) {
  332.         for(new i; i < sizeof(WeaponDEAGLE); i++) {
  333.             num_to_str(i, String, 5)
  334.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponDEAGLE[i][Points]);
  335.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponDEAGLE[i][GunName], g_SelectedGun[id][DEAGLE] == i ? "\y{Kiválasztva}": szMenu2);
  336.             menu_additem(menu, szMenu, String);
  337.         }
  338.     }
  339.     else if(g_Wpn[id] == 12) {
  340.         for(new i; i < sizeof(WeaponUSP); i++) {
  341.             num_to_str(i, String, 5)
  342.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponUSP[i][Points]);
  343.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponUSP[i][GunName], g_SelectedGun[id][USP] == i ? "\y{Kiválasztva}": szMenu2);
  344.             menu_additem(menu, szMenu, String);
  345.         }
  346.     }
  347.     else if(g_Wpn[id] == 13) {
  348.         for(new i; i < sizeof(WeaponGLOCK); i++) {
  349.             num_to_str(i, String, 5)
  350.             formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGLOCK[i][Points]);
  351.             formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGLOCK[i][GunName], g_SelectedGun[id][GLOCK] == i ? "\y{Kiválasztva}": szMenu2);
  352.             menu_additem(menu, szMenu, String);
  353.         }
  354.     }
  355.     menu_display(id, menu, 0);
  356.     return PLUGIN_HANDLED;
  357. }
  358. public hSkinChooser(id, menu, item) {
  359.     if(item == MENU_EXIT)
  360.     {
  361.         menu_destroy(menu);
  362.         return PLUGIN_CONTINUE;
  363.     }
  364.     switch(g_Wpn[id]) {
  365.         case 1: {
  366.             if(g_uPoints[id][M4A1] >= WeaponM4A1[item][Points]) {
  367.                 g_SelectedGun[id][M4A1] = item
  368.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  369.             }
  370.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  371.         }
  372.         case 2: {
  373.             if(g_uPoints[id][AK47] >= WeaponAK47[item][Points]) {
  374.                 g_SelectedGun[id][AK47] = item
  375.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  376.             }
  377.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  378.         }
  379.         case 3: {
  380.             if(g_uPoints[id][AWP] >= WeaponAWP[item][Points]) {
  381.                 g_SelectedGun[id][AWP] = item
  382.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  383.             }
  384.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  385.         }
  386.         case 4: {
  387.             if(g_uPoints[id][SCOUT] >= WeaponSCOUT[item][Points]) {
  388.                 g_SelectedGun[id][SCOUT] = item
  389.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  390.             }
  391.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  392.         }
  393.         case 5: {
  394.             if(g_uPoints[id][FAMAS] >= WeaponFAMAS[item][Points]) {
  395.                 g_SelectedGun[id][FAMAS] = item
  396.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  397.             }
  398.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  399.         }
  400.         case 6: {
  401.             if(g_uPoints[id][GALIL] >= WeaponGALIL[item][Points]) {
  402.                 g_SelectedGun[id][GALIL] = item
  403.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  404.             }
  405.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  406.         }
  407.         case 7: {
  408.             if(g_uPoints[id][AUG] >= WeaponAUG[item][Points]) {
  409.                 g_SelectedGun[id][AUG] = item
  410.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  411.             }
  412.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  413.         }
  414.         case 8: {
  415.             if(g_uPoints[id][M3] >= WeaponM3[item][Points]) {
  416.                 g_SelectedGun[id][M3] = item
  417.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  418.             }
  419.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  420.         }
  421.         case 9: {
  422.             if(g_uPoints[id][XM1014] >= WeaponXM1014[item][Points]) {
  423.                 g_SelectedGun[id][XM1014] = item
  424.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  425.             }
  426.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  427.         }
  428.         case 10: {
  429.             if(g_uPoints[id][KNIFE] >= WeaponKNIFE[item][Points]) {
  430.                 g_SelectedGun[id][KNIFE] = item
  431.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  432.             }
  433.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  434.         }
  435.         case 11: {
  436.             if(g_uPoints[id][DEAGLE] >= WeaponDEAGLE[item][Points]) {
  437.                 g_SelectedGun[id][DEAGLE] = item
  438.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  439.             }
  440.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  441.         }
  442.         case 12: {
  443.             if(g_uPoints[id][USP] >= WeaponUSP[item][Points]) {
  444.                 g_SelectedGun[id][USP] = item
  445.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  446.             }
  447.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  448.         }
  449.         case 13: {
  450.             if(g_uPoints[id][GLOCK] >= WeaponGLOCK[item][Points]) {
  451.                 g_SelectedGun[id][GLOCK] = item
  452.                 client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  453.             }
  454.             else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  455.         }
  456.     }
  457.     menu_destroy(menu);
  458.     return PLUGIN_HANDLED;
  459. }
  460. public client_putinserver(id)
  461. {
  462.     if(is_user_bot(id))
  463.         return;
  464.    
  465.     FunMentes[id] = 1;
  466.     g_uPoints[id][M4A1] = 0;
  467.     g_uPoints[id][AK47] = 0;
  468.     g_uPoints[id][AWP] = 0;
  469.     g_uPoints[id][SCOUT] = 0;
  470.     g_uPoints[id][FAMAS] = 0;
  471.     g_uPoints[id][GALIL] = 0;
  472.     g_uPoints[id][AUG] = 0;
  473.     g_uPoints[id][M3] = 0;
  474.     g_uPoints[id][XM1014] = 0;
  475.     g_uPoints[id][KNIFE] = 0;
  476.     g_uPoints[id][DEAGLE] = 0;
  477.     g_uPoints[id][USP] = 0;
  478.     g_uPoints[id][GLOCK] = 0;
  479.     g_SelectedGun[id][M4A1] = 0;
  480.     g_SelectedGun[id][AK47] = 0;
  481.     g_SelectedGun[id][AWP] = 0;
  482.     g_SelectedGun[id][SCOUT] = 0;
  483.     g_SelectedGun[id][FAMAS] = 0;
  484.     g_SelectedGun[id][GALIL] = 0;
  485.     g_SelectedGun[id][AUG] = 0;
  486.     g_SelectedGun[id][M3] = 0;
  487.     g_SelectedGun[id][XM1014] = 0;
  488.     g_SelectedGun[id][KNIFE] = 0;
  489.     g_SelectedGun[id][DEAGLE] = 0;
  490.     g_SelectedGun[id][USP] = 0;
  491.     g_SelectedGun[id][GLOCK] = 0;
  492.    
  493.     SelectDataTable(id);
  494. }
  495. public client_disconnected(id)
  496. {
  497.     if(is_user_bot(id))
  498.         return;
  499.    
  500.     FunMentes[id] = 0;
  501.     TableUpdate(id);
  502. }
  503. new Handle:g_SqlTuple;
  504. public plugin_cfg()
  505. {
  506.     //Kiszolgáló | Felhasználó | Jelszó | Adatbázis
  507.    
  508.     g_SqlTuple = SQL_MakeDbTuple("maria.srkhost.eu", "", "", "");
  509.     CreateTable();
  510. }
  511. public CreateTable(){
  512.     new iLen;
  513.     static sQuery[10048];
  514.    
  515.     iLen += formatex(sQuery[iLen], charsmax(sQuery), "CREATE TABLE IF NOT EXISTS `%s` ", Tablename);
  516.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "( ");
  517.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`Id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,");
  518.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`SteamId` varchar(64) NOT NULL,");
  519.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM4A1` int(11) NOT NULL,");
  520.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAK47` int(11) NOT NULL,");
  521.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAWP` int(11) NOT NULL,");
  522.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsSCOUT` int(11) NOT NULL,");
  523.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsFAMAS` int(11) NOT NULL,");
  524.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGALIL` int(11) NOT NULL,");
  525.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAUG` int(11) NOT NULL,");
  526.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM3` int(11) NOT NULL,");
  527.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsXM1014` int(11) NOT NULL,");
  528.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsKNIFE` int(11) NOT NULL,");
  529.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsDEAGLE` int(11) NOT NULL,");
  530.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsUSP` int(11) NOT NULL,");
  531.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGLOCK` int(11) NOT NULL,");
  532.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM4A1` int(11) NOT NULL,");
  533.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAK47` int(11) NOT NULL,");
  534.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAWP` int(11) NOT NULL,");
  535.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunSCOUT` int(11) NOT NULL,");
  536.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunFAMAS` int(11) NOT NULL,");
  537.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGALIL` int(11) NOT NULL,");
  538.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAUG` int(11) NOT NULL,");
  539.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM3` int(11) NOT NULL,");
  540.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunXM1014` int(11) NOT NULL,");
  541.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunKNIFE` int(11) NOT NULL,");
  542.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunDEAGLE` int(11) NOT NULL,");
  543.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunUSP` int(11) NOT NULL,");
  544.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGLOCK` int(11) NOT NULL)");
  545.    
  546.     SQL_ThreadQuery(g_SqlTuple, "TableCreateThread", sQuery);
  547. }
  548. public TableUpdate(id)
  549. {
  550.     static sQuery[10048];
  551.     new iLen, sSteamID[64];
  552.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  553.    
  554.     iLen += formatex(sQuery[iLen], charsmax(sQuery), "UPDATE `%s` SET ", Tablename);
  555.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM4A1 = ^"%i^",", g_uPoints[id][M4A1]);
  556.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAK47 = ^"%i^",", g_uPoints[id][AK47]);
  557.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAWP = ^"%i^",", g_uPoints[id][AWP]);
  558.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsSCOUT = ^"%i^",", g_uPoints[id][SCOUT]);
  559.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsFAMAS = ^"%i^",", g_uPoints[id][FAMAS]);
  560.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGALIL = ^"%i^",", g_uPoints[id][GALIL]);
  561.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAUG = ^"%i^",", g_uPoints[id][AUG]);
  562.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM3 = ^"%i^",", g_uPoints[id][M3]);
  563.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsXM1014 = ^"%i^",", g_uPoints[id][XM1014]);
  564.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsKNIFE = ^"%i^",", g_uPoints[id][KNIFE]);
  565.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsDEAGLE = ^"%i^",", g_uPoints[id][DEAGLE]);
  566.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsUSP = ^"%i^",", g_uPoints[id][USP]);
  567.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGLOCK = ^"%i^",", g_uPoints[id][GLOCK]);
  568.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAK47 = ^"%i^",", g_SelectedGun[id][AK47]);
  569.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAWP = ^"%i^",", g_SelectedGun[id][AWP]);
  570.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunSCOUT = ^"%i^",", g_SelectedGun[id][SCOUT]);
  571.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunFAMAS = ^"%i^",", g_SelectedGun[id][FAMAS]);
  572.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGALIL = ^"%i^",", g_SelectedGun[id][GALIL]);
  573.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAUG = ^"%i^",", g_SelectedGun[id][AUG]);
  574.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM3 = ^"%i^",", g_SelectedGun[id][M3]);
  575.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunXM1014 = ^"%i^",", g_SelectedGun[id][XM1014]);
  576.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunKNIFE = ^"%i^",", g_SelectedGun[id][KNIFE]);
  577.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunDEAGLE = ^"%i^",", g_SelectedGun[id][DEAGLE]);
  578.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunUSP = ^"%i^",", g_SelectedGun[id][USP]);
  579.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGLOCK = ^"%i^",", g_SelectedGun[id][GLOCK]);
  580.    
  581.     iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM4A1 = ^"%i^" WHERE `SteamId` = ^"%s^";", g_SelectedGun[id][M4A1], sSteamID);
  582.     SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  583. }
  584. public TableCreateThread(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  585. {
  586.     if(iFailState == TQUERY_CONNECT_FAILED)
  587.         set_fail_state("[Create] Nem lehet csatlakozni az adatbazishoz!");
  588.     else if(iFailState == TQUERY_QUERY_FAILED)
  589.         set_fail_state("[Create] Lekerdezesi hiba");
  590.     if(iErrcode)
  591.         log_amx("[Create] Hiba:**!! %s !!**", sError);
  592. }
  593. public TableInsert(id)
  594. {
  595.     static sQuery[10048], sSteamID[64];
  596.    
  597.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  598.     formatex(sQuery, charsmax(sQuery), "INSERT INTO `%s` (`SteamId`) VALUES (^"%s^");", Tablename, sSteamID);
  599.     SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  600. }
  601. public SelectDataTable(id)
  602. {
  603.     static sQuery[10048];
  604.     new sData[1], sSteamID[64];
  605.     sData[0] = id;
  606.    
  607.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  608.    
  609.     formatex(sQuery, charsmax(sQuery), "SELECT * FROM `%s` WHERE SteamId = ^"%s^";", Tablename, sSteamID);
  610.     SQL_ThreadQuery(g_SqlTuple, "QuerySelectDataTable", sQuery, sData, 2);
  611. }
  612. public QuerySelectDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  613. {
  614.     if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  615.     {
  616.         log_amx("[Insert] Hiba:**!! %s !!**", sError);
  617.         return;
  618.     }
  619.     else
  620.     {
  621.         new id = sData[0];
  622.        
  623.         if(SQL_NumRows(sQuery) > 0)
  624.         {
  625.             g_uPoints[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM4A1"));
  626.             g_uPoints[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAK47"));
  627.             g_uPoints[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAWP"));
  628.             g_uPoints[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsSCOUT"));
  629.             g_uPoints[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsFAMAS"));
  630.             g_uPoints[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGALIL"));
  631.             g_uPoints[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAUG"));
  632.             g_uPoints[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM3"));
  633.             g_uPoints[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsXM1014"));
  634.             g_uPoints[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsKNIFE"));
  635.             g_uPoints[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsDEAGLE"));
  636.             g_uPoints[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsUSP"));
  637.             g_uPoints[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGLOCK"));
  638.             g_SelectedGun[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM4A1"));
  639.             g_SelectedGun[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAK47"));
  640.             g_SelectedGun[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAWP"));
  641.             g_SelectedGun[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunSCOUT"));
  642.             g_SelectedGun[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunFAMAS"));
  643.             g_SelectedGun[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGALIL"));
  644.             g_SelectedGun[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAUG"));
  645.             g_SelectedGun[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM3"));
  646.             g_SelectedGun[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunXM1014"));
  647.             g_SelectedGun[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunKNIFE"));
  648.             g_SelectedGun[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunDEAGLE"));
  649.             g_SelectedGun[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunUSP"));
  650.             g_SelectedGun[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGLOCK"));
  651.         }
  652.         else
  653.             TableInsert(id);
  654.     }
  655. }
  656. public autoSave()
  657. {
  658.     new pnum, id ,sSteamID[64];
  659.     get_user_authid(id, sSteamID, charsmax(sSteamID));
  660.    
  661.     for(new i; i<pnum; i++)
  662.     {
  663.         id = sSteamID[i]  
  664.         set_task(random_float(0.2, 5.0), "TableUpdate", id)
  665.     }
  666.     return PLUGIN_HANDLED
  667. }
  668. public QuerySetDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  669. {
  670.     if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  671.     {
  672.         log_amx("[SetData] Hiba:**!! %s !!**", sError);
  673.         return;
  674.     }
  675. }

_________________
 ! Moderátori megjegyzés (kiki):
Kérlek csekkold az aláírásra vonatkozó szabályokat!


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.17. 17:45 
Offline
Senior Tag
Avatar

Csatlakozott: 2017.08.09. 17:01
Hozzászólások: 261
Megköszönt másnak: 60 alkalommal
Megköszönték neki: 70 alkalommal
Az pl egy jó megoldás amit írtak, de ez a set_taskos frissítés elavult és túlkomplikált, egyszerűbb lenne spawnnál frissíteni a táblát, játékos szerint.

De ha debugolnál sem lenne rossz, azaz chatre iratsz ki dolgokat, meglesni, hogy belefut e az adott publicba, vagy publicon belüli részbe a "program".

_________________
"Szeretek aludni... mert az álmaim szebbek, mint a valóság."


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.18. 10:30 
Offline
Félisten
Avatar

Csatlakozott: 2016.03.06. 14:20
Hozzászólások: 954
Megköszönt másnak: 94 alkalommal
Megköszönték neki: 132 alkalommal
HellEnergY írta:
Az pl egy jó megoldás amit írtak, de ez a set_taskos frissítés elavult és túlkomplikált, egyszerűbb lenne spawnnál frissíteni a táblát, játékos szerint.

De ha debugolnál sem lenne rossz, azaz chatre iratsz ki dolgokat, meglesni, hogy belefut e az adott publicba, vagy publicon belüli részbe a "program".


Miért lenne elavult a se_task-os? Én mindig is azt használtam és egyszer nem volt eltűnt mentés item.

U.i: hibátlanul fut a gyereknek.

_________________
 ! Moderátori megjegyzés (kiki):
Kérlek csekkold az aláírásra vonatkozó szabályokat!

Ők köszönték meg The Peace nek ezt a hozzászólást: saxxo (2022.09.20. 06:33)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2022.09.20. 06:36 
Offline
Jómunkásember

Csatlakozott: 2020.06.14. 17:59
Hozzászólások: 307
Megköszönt másnak: 61 alkalommal
Megköszönték neki: 8 alkalommal
The Peace írta:
HellEnergY írta:
Az pl egy jó megoldás amit írtak, de ez a set_taskos frissítés elavult és túlkomplikált, egyszerűbb lenne spawnnál frissíteni a táblát, játékos szerint.

De ha debugolnál sem lenne rossz, azaz chatre iratsz ki dolgokat, meglesni, hogy belefut e az adott publicba, vagy publicon belüli részbe a "program".


Miért lenne elavult a se_task-os? Én mindig is azt használtam és egyszer nem volt eltűnt mentés item.

U.i: hibátlanul fut a gyereknek.



Helló! Ment Betölt meg minden,akkor van baj ha pályákat, zenéket, vicces hangokat, és stb dolgokat tölt le a szerverről :(

  1. #include <amxmodx>
  2.     #include <engine>
  3.     #include <fakemeta>
  4.     #include <cstrike>
  5.     #include <sqlx>
  6.      
  7.     #define PLUGIN "New Plug-In"
  8.     #define VERSION "1.0"
  9.     #define AUTHOR "author"
  10.      
  11.     #define KILL_POINT 1
  12.     #define HEADSHOT_POINT 5
  13.     #define Tablename "Hlmodra_tabla_1" //SQL Tábla neve!//
  14.      
  15.     enum _:GunDatas {
  16.         M4A1,
  17.         AK47,
  18.         AWP,
  19.         SCOUT,
  20.         FAMAS,
  21.         GALIL,
  22.         AUG,
  23.         M3,
  24.         XM1014,
  25.         KNIFE,
  26.         DEAGLE,
  27.         USP,
  28.         GLOCK
  29.     }
  30.     new g_SelectedGun[33][GunDatas], g_uPoints[33][GunDatas], g_Wpn[33];
  31.     new sSteamID[64];
  32.      
  33.     new const gMenuPrefix[] = "\w[<<< Night~Warrior >>>]~\y»\yFun";
  34.     new const gChatPrefix[] = "[<<< Night~Warrior >>>]"
  35.      
  36.     enum _:DATA {
  37.         GunName[64],
  38.         ModelName[64],
  39.         Points[8]
  40.     }
  41.     new const WeaponM4A1[][DATA] = {
  42.         {"M4A1 | Default", "models/v_m4a1.mdl", 0, },
  43.     }
  44.     new const WeaponAK47[][DATA] = {
  45.         {"AK47 | Default", "models/v_ak47.mdl", 0, },
  46.     }
  47.     new const WeaponAWP[][DATA] = {
  48.         {"AWP | Default", "models/v_awp.mdl", 0, },
  49.     }
  50.     new const WeaponSCOUT[][DATA] = {
  51.         {"SCOUT | Default", "models/v_scout.mdl", 0, },
  52.     }
  53.     new const WeaponFAMAS[][DATA] = {
  54.         {"FAMAS | Default", "models/v_famas.mdl", 0, },
  55.     }
  56.     new const WeaponGALIL[][DATA] = {
  57.         {"GALIL | Default", "models/v_galil.mdl", 0, },
  58.     }
  59.     new const WeaponAUG[][DATA] = {
  60.         {"AUG | Default", "models/v_aug.mdl", 0, },
  61.     }
  62.     new const WeaponM3[][DATA] = {
  63.         {"M3 | Default", "models/v_m3.mdl", 0, },
  64.     }
  65.     new const WeaponXM1014[][DATA] = {
  66.         {"XM1014 | Default", "models/v_xm1014.mdl", 0, },
  67.     }
  68.     new const WeaponKNIFE[][DATA] = {
  69.         {"KNIFE | Default", "models/v_knife.mdl", 0, },
  70.     }
  71.     new const WeaponDEAGLE[][DATA] = {
  72.         {"DEAGLE | Default", "models/v_deagle.mdl", 0, },
  73.     }
  74.     new const WeaponUSP[][DATA] = {
  75.         {"USP | Default", "models/v_usp.mdl", 0, },
  76.     }
  77.     new const WeaponGLOCK[][DATA] = {
  78.         {"GLOCK18 | Default", "models/v_glock18.mdl", 0, },
  79.     }  
  80.     new const MainStrings[][] = {
  81.         "M4A1 Skinek",
  82.         "AK47 Skinek",
  83.         "AWP Skinek",
  84.         "SCOUT Skinek",
  85.         "FAMAS Skinek",
  86.         "GALIL Skinek",
  87.         "AUG Skinek",
  88.         "M3 Skinek",
  89.         "XM1014 Skinek",
  90.         "KNIFE Skinek",
  91.         "DEAGLE Skinek",
  92.         "USP Skinek",
  93.         "GLOCK18 Skinek"
  94.     }
  95.     public plugin_init() {
  96.         register_plugin(PLUGIN, VERSION, AUTHOR)
  97.         register_clcmd("say /menu", "openMainMenu")
  98.         register_clcmd("say /add", "Addolas")
  99.        
  100.         register_impulse(201, "openMainMenu");
  101.        
  102.         register_event("DeathMsg","Halal","a")
  103.         register_event("CurWeapon", "evChangeWeapon", "be", "1=1")
  104.        
  105.         set_task(15.0,"autoSave",.flags="b")
  106.     }
  107.     public Addolas(id)
  108.     {
  109.         g_uPoints[id][M4A1] += 50
  110.         g_uPoints[id][AK47] += 50
  111.         g_uPoints[id][AWP] += 50
  112.         g_uPoints[id][SCOUT] += 50
  113.         g_uPoints[id][FAMAS] += 50
  114.         g_uPoints[id][GALIL] += 50
  115.         g_uPoints[id][AUG] += 50
  116.         g_uPoints[id][M3] += 50
  117.         g_uPoints[id][XM1014] += 50
  118.         g_uPoints[id][KNIFE] += 50
  119.         g_uPoints[id][DEAGLE] += 50
  120.         g_uPoints[id][USP] += 50
  121.         g_uPoints[id][GLOCK] += 50;
  122.     }
  123.     public plugin_precache() {
  124.         for(new i;i < sizeof(WeaponM4A1); i++) precache_model(WeaponM4A1[i][ModelName])
  125.         for(new i;i < sizeof(WeaponAK47); i++) precache_model(WeaponAK47[i][ModelName])
  126.         for(new i;i < sizeof(WeaponAWP); i++) precache_model(WeaponAWP[i][ModelName])
  127.         for(new i;i < sizeof(WeaponSCOUT); i++) precache_model(WeaponSCOUT[i][ModelName])
  128.         for(new i;i < sizeof(WeaponFAMAS); i++) precache_model(WeaponFAMAS[i][ModelName])
  129.         for(new i;i < sizeof(WeaponGALIL); i++) precache_model(WeaponGALIL[i][ModelName])
  130.         for(new i;i < sizeof(WeaponAUG); i++) precache_model(WeaponAUG[i][ModelName])
  131.         for(new i;i < sizeof(WeaponM3); i++) precache_model(WeaponM3[i][ModelName])
  132.         for(new i;i < sizeof(WeaponXM1014); i++) precache_model(WeaponXM1014[i][ModelName])
  133.         for(new i;i < sizeof(WeaponKNIFE); i++) precache_model(WeaponKNIFE[i][ModelName])
  134.         for(new i;i < sizeof(WeaponDEAGLE); i++) precache_model(WeaponDEAGLE[i][ModelName])
  135.         for(new i;i < sizeof(WeaponUSP); i++) precache_model(WeaponUSP[i][ModelName])
  136.         for(new i;i < sizeof(WeaponGLOCK); i++) precache_model(WeaponGLOCK[i][ModelName])
  137.     }
  138.     public evChangeWeapon(id) {
  139.         switch(get_user_weapon(id)) {
  140.             case CSW_M4A1: entity_set_string(id, EV_SZ_viewmodel, WeaponM4A1[g_SelectedGun[id][M4A1]][ModelName]);
  141.                 case CSW_AK47: entity_set_string(id, EV_SZ_viewmodel, WeaponAK47[g_SelectedGun[id][AK47]][ModelName]);
  142.                 case CSW_AWP: entity_set_string(id, EV_SZ_viewmodel, WeaponAWP[g_SelectedGun[id][AWP]][ModelName]);
  143.                 case CSW_SCOUT: entity_set_string(id, EV_SZ_viewmodel, WeaponSCOUT[g_SelectedGun[id][SCOUT]][ModelName]);
  144.                 case CSW_FAMAS: entity_set_string(id, EV_SZ_viewmodel, WeaponFAMAS[g_SelectedGun[id][FAMAS]][ModelName]);
  145.                 case CSW_GALIL: entity_set_string(id, EV_SZ_viewmodel, WeaponGALIL[g_SelectedGun[id][GALIL]][ModelName]);
  146.                 case CSW_AUG: entity_set_string(id, EV_SZ_viewmodel, WeaponAUG[g_SelectedGun[id][AUG]][ModelName]);
  147.                 case CSW_M3: entity_set_string(id, EV_SZ_viewmodel, WeaponM3[g_SelectedGun[id][M3]][ModelName]);
  148.                 case CSW_XM1014: entity_set_string(id, EV_SZ_viewmodel, WeaponXM1014[g_SelectedGun[id][XM1014]][ModelName]);
  149.                 case CSW_KNIFE: entity_set_string(id, EV_SZ_viewmodel, WeaponKNIFE[g_SelectedGun[id][KNIFE]][ModelName]);
  150.                 case CSW_DEAGLE: entity_set_string(id, EV_SZ_viewmodel, WeaponDEAGLE[g_SelectedGun[id][DEAGLE]][ModelName]);
  151.                 case CSW_USP: entity_set_string(id, EV_SZ_viewmodel, WeaponUSP[g_SelectedGun[id][USP]][ModelName]);
  152.                 case CSW_GLOCK18: entity_set_string(id, EV_SZ_viewmodel, WeaponGLOCK[g_SelectedGun[id][GLOCK]][ModelName]);
  153.             }
  154.         return PLUGIN_CONTINUE
  155.     }
  156.     public Halal() {
  157.        
  158.         new iAttacker = read_data(1)
  159.         new iVictim = read_data(2)
  160.         new iHs = read_data(3)
  161.        
  162.         if(iAttacker == iVictim || iAttacker == 0) return PLUGIN_HANDLED
  163.         new iPoints = iHs ? HEADSHOT_POINT : KILL_POINT
  164.        
  165.         switch(get_user_weapon(iAttacker)) {
  166.             case CSW_M4A1: g_uPoints[iAttacker][M4A1] += iPoints
  167.                 case CSW_AK47: g_uPoints[iAttacker][AK47] += iPoints
  168.                 case CSW_AWP: g_uPoints[iAttacker][AWP] += iPoints
  169.                 case CSW_SCOUT: g_uPoints[iAttacker][SCOUT] += iPoints
  170.                 case CSW_FAMAS: g_uPoints[iAttacker][FAMAS] += iPoints
  171.                 case CSW_GALIL: g_uPoints[iAttacker][GALIL] += iPoints
  172.                 case CSW_AUG: g_uPoints[iAttacker][AUG] += iPoints
  173.                 case CSW_M3: g_uPoints[iAttacker][M3] += iPoints
  174.                 case CSW_XM1014: g_uPoints[iAttacker][XM1014] += iPoints
  175.                 case CSW_KNIFE: g_uPoints[iAttacker][KNIFE] += iPoints
  176.                 case CSW_DEAGLE: g_uPoints[iAttacker][DEAGLE] += iPoints
  177.                 case CSW_USP: g_uPoints[iAttacker][USP] += iPoints
  178.                 case CSW_GLOCK18: g_uPoints[iAttacker][GLOCK] += iPoints
  179.             }
  180.         set_hudmessage(random(256), random(256), random(256), -1.0, 0.20, 0, 6.0, 3.0);
  181.         show_hudmessage(iAttacker, "+%i Pont", iPoints);
  182.         return PLUGIN_CONTINUE;
  183.     }
  184.     public openMainMenu(id) {
  185.         new szMenu[121], String[6]
  186.         formatex(szMenu, charsmax(szMenu), "%s \wFőMenü", gChatPrefix);
  187.         new menu = menu_create(szMenu, "hMainMenu");
  188.        
  189.         for(new i ;i < sizeof(MainStrings); i++) {
  190.             num_to_str(i, String, 5)
  191.             formatex(szMenu, charsmax(szMenu), MainStrings[i]);
  192.             menu_additem(menu, szMenu, String);
  193.         }
  194.         menu_display(id, menu, 0);
  195.         return PLUGIN_HANDLED;
  196.     }
  197.     public hMainMenu(id, menu, item) {
  198.         if(item == MENU_EXIT) {
  199.             menu_destroy(menu);
  200.             return PLUGIN_HANDLED;
  201.         }
  202.         g_Wpn[id] = item+1
  203.         openSkinMenu(id)
  204.         menu_destroy(menu);
  205.         return PLUGIN_HANDLED;
  206.     }
  207.     public openSkinMenu(id) {
  208.         new szMenu[121], szMenu2[64], String[6]
  209.         if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  210.         else if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  211.             else if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  212.             else if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  213.             else if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  214.             else if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  215.             else if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  216.             else if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  217.             else if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  218.             else if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  219.             else if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  220.             else if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  221.             else if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix, MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  222.         new menu = menu_create(szMenu, "hSkinChooser");
  223.         if(g_Wpn[id] == 1) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  224.         MainStrings[g_Wpn[id]-1], g_uPoints[id][M4A1])
  225.         if(g_Wpn[id] == 2) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  226.         MainStrings[g_Wpn[id]-1], g_uPoints[id][AK47])
  227.         if(g_Wpn[id] == 3) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  228.         MainStrings[g_Wpn[id]-1], g_uPoints[id][AWP])
  229.         if(g_Wpn[id] == 4) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  230.         MainStrings[g_Wpn[id]-1], g_uPoints[id][SCOUT])
  231.         if(g_Wpn[id] == 5) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  232.         MainStrings[g_Wpn[id]-1], g_uPoints[id][FAMAS])
  233.         if(g_Wpn[id] == 6) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  234.         MainStrings[g_Wpn[id]-1], g_uPoints[id][GALIL])
  235.         if(g_Wpn[id] == 7) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  236.         MainStrings[g_Wpn[id]-1], g_uPoints[id][AUG])
  237.         if(g_Wpn[id] == 8) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  238.         MainStrings[g_Wpn[id]-1], g_uPoints[id][M3])
  239.         if(g_Wpn[id] == 9) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  240.         MainStrings[g_Wpn[id]-1], g_uPoints[id][XM1014])
  241.         if(g_Wpn[id] == 10) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  242.         MainStrings[g_Wpn[id]-1], g_uPoints[id][KNIFE])
  243.         if(g_Wpn[id] == 11) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  244.         MainStrings[g_Wpn[id]-1], g_uPoints[id][DEAGLE])
  245.         if(g_Wpn[id] == 12) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  246.         MainStrings[g_Wpn[id]-1], g_uPoints[id][USP])
  247.         if(g_Wpn[id] == 13) formatex(szMenu, charsmax(szMenu), "%s \w%s^n\wPontjaid: \y%i\d", gChatPrefix,
  248.         MainStrings[g_Wpn[id]-1], g_uPoints[id][GLOCK])
  249.        
  250.         if(g_Wpn[id] == 1) {
  251.             for(new i; i < sizeof(WeaponM4A1); i++) {
  252.                 num_to_str(i, String, 5)
  253.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM4A1[i][Points]);
  254.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM4A1[i][GunName], g_SelectedGun[id][M4A1] == i ? "\y{Kiválasztva}": szMenu2);
  255.                 menu_additem(menu, szMenu, String);
  256.             }
  257.         }
  258.         else if(g_Wpn[id] == 2) {
  259.             for(new i; i < sizeof(WeaponAK47); i++) {
  260.                 num_to_str(i, String, 5)
  261.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAK47[i][Points]);
  262.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAK47[i][GunName], g_SelectedGun[id][AK47] == i ? "\y{Kiválasztva}": szMenu2);
  263.                 menu_additem(menu, szMenu, String);
  264.             }
  265.         }
  266.         else if(g_Wpn[id] == 3) {
  267.             for(new i; i < sizeof(WeaponAWP); i++) {
  268.                 num_to_str(i, String, 5)
  269.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAWP[i][Points]);
  270.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAWP[i][GunName], g_SelectedGun[id][AWP] == i ? "\y{Kiválasztva}": szMenu2);
  271.                 menu_additem(menu, szMenu, String);
  272.             }
  273.         }
  274.         else if(g_Wpn[id] == 4) {
  275.             for(new i; i < sizeof(WeaponSCOUT); i++) {
  276.                 num_to_str(i, String, 5)
  277.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponSCOUT[i][Points]);
  278.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponSCOUT[i][GunName], g_SelectedGun[id][SCOUT] == i ? "\y{Kiválasztva}": szMenu2);
  279.                 menu_additem(menu, szMenu, String);
  280.             }
  281.         }
  282.         else if(g_Wpn[id] == 5) {
  283.             for(new i; i < sizeof(WeaponFAMAS); i++) {
  284.                 num_to_str(i, String, 5)
  285.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponFAMAS[i][Points]);
  286.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponFAMAS[i][GunName], g_SelectedGun[id][FAMAS] == i ? "\y{Kiválasztva}": szMenu2);
  287.                 menu_additem(menu, szMenu, String);
  288.             }
  289.         }
  290.         else if(g_Wpn[id] == 6) {
  291.             for(new i; i < sizeof(WeaponGALIL); i++) {
  292.                 num_to_str(i, String, 5)
  293.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGALIL[i][Points]);
  294.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGALIL[i][GunName], g_SelectedGun[id][GALIL] == i ? "\y{Kiválasztva}": szMenu2);
  295.                 menu_additem(menu, szMenu, String);
  296.             }
  297.         }
  298.         else if(g_Wpn[id] == 7) {
  299.             for(new i; i < sizeof(WeaponAUG); i++) {
  300.                 num_to_str(i, String, 5)
  301.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponAUG[i][Points]);
  302.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponAUG[i][GunName], g_SelectedGun[id][AUG] == i ? "\y{Kiválasztva}": szMenu2);
  303.                 menu_additem(menu, szMenu, String);
  304.             }
  305.         }
  306.         else if(g_Wpn[id] == 8) {
  307.             for(new i; i < sizeof(WeaponM3); i++) {
  308.                 num_to_str(i, String, 5)
  309.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponM3[i][Points]);
  310.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponM3[i][GunName], g_SelectedGun[id][M3] == i ? "\y{Kiválasztva}": szMenu2);
  311.                 menu_additem(menu, szMenu, String);
  312.             }
  313.         }
  314.         else if(g_Wpn[id] == 9) {
  315.             for(new i; i < sizeof(WeaponXM1014); i++) {
  316.                 num_to_str(i, String, 5)
  317.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponXM1014[i][Points]);
  318.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponXM1014[i][GunName], g_SelectedGun[id][XM1014] == i ? "\y{Kiválasztva}": szMenu2);
  319.                 menu_additem(menu, szMenu, String);
  320.             }
  321.         }
  322.         else if(g_Wpn[id] == 10) {
  323.             for(new i; i < sizeof(WeaponKNIFE); i++) {
  324.                 num_to_str(i, String, 5)
  325.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponKNIFE[i][Points]);
  326.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponKNIFE[i][GunName], g_SelectedGun[id][KNIFE] == i ? "\y{Kiválasztva}": szMenu2);
  327.                 menu_additem(menu, szMenu, String);
  328.             }
  329.         }
  330.         else if(g_Wpn[id] == 11) {
  331.             for(new i; i < sizeof(WeaponDEAGLE); i++) {
  332.                 num_to_str(i, String, 5)
  333.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponDEAGLE[i][Points]);
  334.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponDEAGLE[i][GunName], g_SelectedGun[id][DEAGLE] == i ? "\y{Kiválasztva}": szMenu2);
  335.                 menu_additem(menu, szMenu, String);
  336.             }
  337.         }
  338.         else if(g_Wpn[id] == 12) {
  339.             for(new i; i < sizeof(WeaponUSP); i++) {
  340.                 num_to_str(i, String, 5)
  341.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponUSP[i][Points]);
  342.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponUSP[i][GunName], g_SelectedGun[id][USP] == i ? "\y{Kiválasztva}": szMenu2);
  343.                 menu_additem(menu, szMenu, String);
  344.             }
  345.         }
  346.         else if(g_Wpn[id] == 13) {
  347.             for(new i; i < sizeof(WeaponGLOCK); i++) {
  348.                 num_to_str(i, String, 5)
  349.                 formatex(szMenu2, charsmax(szMenu2), "\r{%i} Ölés", WeaponGLOCK[i][Points]);
  350.                 formatex(szMenu, charsmax(szMenu), "%s %s", WeaponGLOCK[i][GunName], g_SelectedGun[id][GLOCK] == i ? "\y{Kiválasztva}": szMenu2);
  351.                 menu_additem(menu, szMenu, String);
  352.             }
  353.         }
  354.         menu_display(id, menu, 0);
  355.         return PLUGIN_HANDLED;
  356.     }
  357.     public hSkinChooser(id, menu, item) {
  358.         if(item == MENU_EXIT)
  359.         {
  360.             menu_destroy(menu);
  361.             return PLUGIN_CONTINUE;
  362.         }
  363.         switch(g_Wpn[id]) {
  364.             case 1: {
  365.                 if(g_uPoints[id][M4A1] >= WeaponM4A1[item][Points]) {
  366.                     g_SelectedGun[id][M4A1] = item
  367.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  368.                 }
  369.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  370.             }
  371.             case 2: {
  372.                 if(g_uPoints[id][AK47] >= WeaponAK47[item][Points]) {
  373.                     g_SelectedGun[id][AK47] = item
  374.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  375.                 }
  376.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  377.             }
  378.             case 3: {
  379.                 if(g_uPoints[id][AWP] >= WeaponAWP[item][Points]) {
  380.                     g_SelectedGun[id][AWP] = item
  381.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  382.                 }
  383.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  384.             }
  385.             case 4: {
  386.                 if(g_uPoints[id][SCOUT] >= WeaponSCOUT[item][Points]) {
  387.                     g_SelectedGun[id][SCOUT] = item
  388.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  389.                 }
  390.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  391.             }
  392.             case 5: {
  393.                 if(g_uPoints[id][FAMAS] >= WeaponFAMAS[item][Points]) {
  394.                     g_SelectedGun[id][FAMAS] = item
  395.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  396.                 }
  397.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  398.             }
  399.             case 6: {
  400.                 if(g_uPoints[id][GALIL] >= WeaponGALIL[item][Points]) {
  401.                     g_SelectedGun[id][GALIL] = item
  402.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  403.                 }
  404.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  405.             }
  406.             case 7: {
  407.                 if(g_uPoints[id][AUG] >= WeaponAUG[item][Points]) {
  408.                     g_SelectedGun[id][AUG] = item
  409.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  410.                 }
  411.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  412.             }
  413.             case 8: {
  414.                 if(g_uPoints[id][M3] >= WeaponM3[item][Points]) {
  415.                     g_SelectedGun[id][M3] = item
  416.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  417.                 }
  418.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  419.             }
  420.             case 9: {
  421.                 if(g_uPoints[id][XM1014] >= WeaponXM1014[item][Points]) {
  422.                     g_SelectedGun[id][XM1014] = item
  423.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  424.                 }
  425.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  426.             }
  427.             case 10: {
  428.                 if(g_uPoints[id][KNIFE] >= WeaponKNIFE[item][Points]) {
  429.                     g_SelectedGun[id][KNIFE] = item
  430.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  431.                 }
  432.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  433.             }
  434.             case 11: {
  435.                 if(g_uPoints[id][DEAGLE] >= WeaponDEAGLE[item][Points]) {
  436.                     g_SelectedGun[id][DEAGLE] = item
  437.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  438.                 }
  439.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  440.             }
  441.             case 12: {
  442.                 if(g_uPoints[id][USP] >= WeaponUSP[item][Points]) {
  443.                     g_SelectedGun[id][USP] = item
  444.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  445.                 }
  446.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  447.             }
  448.             case 13: {
  449.                 if(g_uPoints[id][GLOCK] >= WeaponGLOCK[item][Points]) {
  450.                     g_SelectedGun[id][GLOCK] = item
  451.                     client_print_color(id, print_team_blue, "^4%s ^1Sikeresen aktiváltad a skint!", gChatPrefix);
  452.                 }
  453.                 else client_print_color(id, print_team_blue, "^4%s ^1Sajnálom, nincs elegendő ^3pontod^3!", gChatPrefix);
  454.             }
  455.         }
  456.         menu_destroy(menu);
  457.         return PLUGIN_HANDLED;
  458.     }
  459.     public client_putinserver(id)
  460.     {
  461.         if(is_user_bot(id))
  462.             return;
  463.        
  464.         g_uPoints[id][M4A1] = 0;
  465.         g_uPoints[id][AK47] = 0;
  466.         g_uPoints[id][AWP] = 0;
  467.         g_uPoints[id][SCOUT] = 0;
  468.         g_uPoints[id][FAMAS] = 0;
  469.         g_uPoints[id][GALIL] = 0;
  470.         g_uPoints[id][AUG] = 0;
  471.         g_uPoints[id][M3] = 0;
  472.         g_uPoints[id][XM1014] = 0;
  473.         g_uPoints[id][KNIFE] = 0;
  474.         g_uPoints[id][DEAGLE] = 0;
  475.         g_uPoints[id][USP] = 0;
  476.         g_uPoints[id][GLOCK] = 0;
  477.         g_SelectedGun[id][M4A1] = 0;
  478.         g_SelectedGun[id][AK47] = 0;
  479.         g_SelectedGun[id][AWP] = 0;
  480.         g_SelectedGun[id][SCOUT] = 0;
  481.         g_SelectedGun[id][FAMAS] = 0;
  482.         g_SelectedGun[id][GALIL] = 0;
  483.         g_SelectedGun[id][AUG] = 0;
  484.         g_SelectedGun[id][M3] = 0;
  485.         g_SelectedGun[id][XM1014] = 0;
  486.         g_SelectedGun[id][KNIFE] = 0;
  487.         g_SelectedGun[id][DEAGLE] = 0;
  488.         g_SelectedGun[id][USP] = 0;
  489.         g_SelectedGun[id][GLOCK] = 0;
  490.        
  491.         SelectDataTable(id);
  492.     }
  493.     public client_disconnected(id)
  494.     {
  495.         if(is_user_bot(id))
  496.             return;
  497.        
  498.         TableUpdate(id);
  499.     }
  500.     new Handle:g_SqlTuple;
  501.     public plugin_cfg()
  502.     {
  503.         //Kiszolgáló | Felhasználó | Jelszó | Adatbázis
  504.        
  505.         g_SqlTuple = SQL_MakeDbTuple("maria.srkhost.eu", "", "", "s17878_newszerver");
  506.         CreateTable();
  507.     }
  508.     public CreateTable(){
  509.         new iLen;
  510.         static sQuery[10048];
  511.        
  512.         iLen += formatex(sQuery[iLen], charsmax(sQuery), "CREATE TABLE IF NOT EXISTS `%s` ", Tablename);
  513.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "( ");
  514.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`Id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,");
  515.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`SteamId` varchar(64) NOT NULL,");
  516.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM4A1` int(11) NOT NULL,");
  517.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAK47` int(11) NOT NULL,");
  518.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAWP` int(11) NOT NULL,");
  519.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsSCOUT` int(11) NOT NULL,");
  520.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsFAMAS` int(11) NOT NULL,");
  521.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGALIL` int(11) NOT NULL,");
  522.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsAUG` int(11) NOT NULL,");
  523.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsM3` int(11) NOT NULL,");
  524.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsXM1014` int(11) NOT NULL,");
  525.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsKNIFE` int(11) NOT NULL,");
  526.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsDEAGLE` int(11) NOT NULL,");
  527.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsUSP` int(11) NOT NULL,");
  528.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_uPointsGLOCK` int(11) NOT NULL,");
  529.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM4A1` int(11) NOT NULL,");
  530.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAK47` int(11) NOT NULL,");
  531.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAWP` int(11) NOT NULL,");
  532.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunSCOUT` int(11) NOT NULL,");
  533.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunFAMAS` int(11) NOT NULL,");
  534.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGALIL` int(11) NOT NULL,");
  535.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunAUG` int(11) NOT NULL,");
  536.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunM3` int(11) NOT NULL,");
  537.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunXM1014` int(11) NOT NULL,");
  538.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunKNIFE` int(11) NOT NULL,");
  539.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunDEAGLE` int(11) NOT NULL,");
  540.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunUSP` int(11) NOT NULL,");
  541.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "`g_SelectedGunGLOCK` int(11) NOT NULL)");
  542.        
  543.         SQL_ThreadQuery(g_SqlTuple, "TableCreateThread", sQuery);
  544.     }
  545.     public TableUpdate(id)
  546.     {
  547.         static sQuery[10048];
  548.         new iLen, sSteamID[64];
  549.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  550.        
  551.         iLen += formatex(sQuery[iLen], charsmax(sQuery), "UPDATE `%s` SET ", Tablename);
  552.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM4A1 = ^"%i^",", g_uPoints[id][M4A1]);
  553.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAK47 = ^"%i^",", g_uPoints[id][AK47]);
  554.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAWP = ^"%i^",", g_uPoints[id][AWP]);
  555.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsSCOUT = ^"%i^",", g_uPoints[id][SCOUT]);
  556.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsFAMAS = ^"%i^",", g_uPoints[id][FAMAS]);
  557.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGALIL = ^"%i^",", g_uPoints[id][GALIL]);
  558.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsAUG = ^"%i^",", g_uPoints[id][AUG]);
  559.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsM3 = ^"%i^",", g_uPoints[id][M3]);
  560.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsXM1014 = ^"%i^",", g_uPoints[id][XM1014]);
  561.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsKNIFE = ^"%i^",", g_uPoints[id][KNIFE]);
  562.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsDEAGLE = ^"%i^",", g_uPoints[id][DEAGLE]);
  563.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsUSP = ^"%i^",", g_uPoints[id][USP]);
  564.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_uPointsGLOCK = ^"%i^",", g_uPoints[id][GLOCK]);
  565.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAK47 = ^"%i^",", g_SelectedGun[id][AK47]);
  566.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAWP = ^"%i^",", g_SelectedGun[id][AWP]);
  567.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunSCOUT = ^"%i^",", g_SelectedGun[id][SCOUT]);
  568.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunFAMAS = ^"%i^",", g_SelectedGun[id][FAMAS]);
  569.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGALIL = ^"%i^",", g_SelectedGun[id][GALIL]);
  570.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunAUG = ^"%i^",", g_SelectedGun[id][AUG]);
  571.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM3 = ^"%i^",", g_SelectedGun[id][M3]);
  572.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunXM1014 = ^"%i^",", g_SelectedGun[id][XM1014]);
  573.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunKNIFE = ^"%i^",", g_SelectedGun[id][KNIFE]);
  574.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunDEAGLE = ^"%i^",", g_SelectedGun[id][DEAGLE]);
  575.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunUSP = ^"%i^",", g_SelectedGun[id][USP]);
  576.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunGLOCK = ^"%i^",", g_SelectedGun[id][GLOCK]);
  577.        
  578.         iLen += formatex(sQuery[iLen], charsmax(sQuery)-iLen, "g_SelectedGunM4A1 = ^"%i^" WHERE `SteamId` = ^"%s^";", g_SelectedGun[id][M4A1], sSteamID);
  579.         SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  580.     }
  581.     public TableCreateThread(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  582.     {
  583.         if(iFailState == TQUERY_CONNECT_FAILED)
  584.             set_fail_state("[Create] Nem lehet csatlakozni az adatbazishoz!");
  585.         else if(iFailState == TQUERY_QUERY_FAILED)
  586.             set_fail_state("[Create] Lekerdezesi hiba");
  587.         if(iErrcode)
  588.             log_amx("[Create] Hiba:**!! %s !!**", sError);
  589.     }
  590.     public TableInsert(id)
  591.     {
  592.         static sQuery[10048], sSteamID[64];
  593.        
  594.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  595.         formatex(sQuery, charsmax(sQuery), "INSERT INTO `%s` (`SteamId`) VALUES (^"%s^");", Tablename, sSteamID);
  596.         SQL_ThreadQuery(g_SqlTuple, "QuerySetDataTable", sQuery);
  597.     }
  598.     public SelectDataTable(id)
  599.     {
  600.         static sQuery[10048];
  601.         new sData[1], sSteamID[64];
  602.         sData[0] = id;
  603.        
  604.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  605.        
  606.         formatex(sQuery, charsmax(sQuery), "SELECT * FROM `%s` WHERE SteamId = ^"%s^";", Tablename, sSteamID);
  607.         SQL_ThreadQuery(g_SqlTuple, "QuerySelectDataTable", sQuery, sData, 1);
  608.     }
  609.     public QuerySelectDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  610.     {
  611.         if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  612.         {
  613.             log_amx("[Insert] Hiba:**!! %s !!**", sError);
  614.             return;
  615.         }
  616.         else
  617.         {
  618.             new id = sData[0];
  619.            
  620.             if(SQL_NumRows(sQuery) > 0)
  621.             {
  622.                 g_uPoints[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM4A1"));
  623.                 g_uPoints[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAK47"));
  624.                 g_uPoints[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAWP"));
  625.                 g_uPoints[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsSCOUT"));
  626.                 g_uPoints[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsFAMAS"));
  627.                 g_uPoints[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGALIL"));
  628.                 g_uPoints[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsAUG"));
  629.                 g_uPoints[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsM3"));
  630.                 g_uPoints[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsXM1014"));
  631.                 g_uPoints[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsKNIFE"));
  632.                 g_uPoints[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsDEAGLE"));
  633.                 g_uPoints[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsUSP"));
  634.                 g_uPoints[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_uPointsGLOCK"));
  635.                 g_SelectedGun[id][M4A1] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM4A1"));
  636.                 g_SelectedGun[id][AK47] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAK47"));
  637.                 g_SelectedGun[id][AWP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAWP"));
  638.                 g_SelectedGun[id][SCOUT] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunSCOUT"));
  639.                 g_SelectedGun[id][FAMAS] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunFAMAS"));
  640.                 g_SelectedGun[id][GALIL] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGALIL"));
  641.                 g_SelectedGun[id][AUG] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunAUG"));
  642.                 g_SelectedGun[id][M3] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunM3"));
  643.                 g_SelectedGun[id][XM1014] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunXM1014"));
  644.                 g_SelectedGun[id][KNIFE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunKNIFE"));
  645.                 g_SelectedGun[id][DEAGLE] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunDEAGLE"));
  646.                 g_SelectedGun[id][USP] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunUSP"));
  647.                 g_SelectedGun[id][GLOCK] = SQL_ReadResult(sQuery, SQL_FieldNameToNum(sQuery, "g_SelectedGunGLOCK"));
  648.             }
  649.             else
  650.                 TableInsert(id);
  651.         }
  652.     }
  653.     public autoSave()
  654.     {
  655.         new pnum, id ,sSteamID[64];
  656.         get_user_authid(id, sSteamID, charsmax(sSteamID));
  657.        
  658.         for(new i; i<pnum; i++)
  659.         {
  660.             id = sSteamID[i]  
  661.             set_task(random_float(0.2, 5.0), "TableUpdate", id)
  662.         }
  663.         return PLUGIN_HANDLED
  664.     }
  665.     public QuerySetDataTable(iFailState, Handle:sQuery, sError[], iErrcode, sData[], iDataSize, Float:fQueuetime)
  666.     {
  667.         if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
  668.         {
  669.             log_amx("[SetData] Hiba:**!! %s !!**", sError);
  670.             return;
  671.         }
  672.     }


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  [ 7 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 14 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