hlmod.hu

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



Jelenlévő felhasználók

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

A legtöbb felhasználó (2883 fő) 2025.07.30. 16:00-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]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  [4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: utvonal nem jó
HozzászólásElküldve:Ma, 19:42 
Offline
Jómunkásember

Csatlakozott:2020.06.14. 17:59
Hozzászólások:447
Megköszönt másnak: 83 alkalommal
Megköszönték neki: 8 alkalommal
Helló!
Miért nem jó ez az útvonal?

Eredeti
  1. ;"hat name" "models/hats_folder/hat_model.mdl"


Általam megadott
  1. "Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája:
HozzászólásElküldve:Ma, 19:49 
Offline
Jómunkásember
Avatar

Csatlakozott:2019.11.03. 22:00
Hozzászólások:415
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 33 alkalommal
saxxo írta:
Helló!
Miért nem jó ez az útvonal?

Eredeti
  1. ;"hat name" "models/hats_folder/hat_model.mdl"


Általam megadott
  1. "Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"

  1. ;"Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"

_________________
BiG BrotherZ AWP
IP >awp.bigbrotherz.hu:27075


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája:
HozzászólásElküldve:Ma, 20:00 
Offline
Jómunkásember

Csatlakozott:2020.06.14. 17:59
Hozzászólások:447
Megköszönt másnak: 83 alkalommal
Megköszönték neki: 8 alkalommal
Csabika20034 írta:
saxxo írta:
Helló!
Miért nem jó ez az útvonal?

Eredeti
  1. ;"hat name" "models/hats_folder/hat_model.mdl"


Általam megadott
  1. "Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"

  1. ;"Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"


  1. L 02/28/2026 - 18:58:34: [ENGINE] Entity 0 can not be removed
  2. L 02/28/2026 - 18:58:34: [AMXX] Displaying debug trace (plugin "sapi.amxx", version "1.0")
  3. L 02/28/2026 - 18:58:34: [AMXX] Run time error 10: native error (native "remove_entity")
  4. L 02/28/2026 - 18:58:34: [AMXX]    [0] sapi.sma::Hats_Handler (line 178)



  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4.  
  5. new const Plugin[] = {"Sapik"}
  6. new const Version[] = {"1.0"}
  7. new const Author[] = {"LyleChriss"}
  8.  
  9. new const Prefix[] = {"FTW"}
  10.  
  11. //#define FLAG  ADMIN_KICK
  12.  
  13. new const MenuCmds[][] = {
  14.     "say /sapka",
  15.     "say /sapik",
  16.     "say /sapi"
  17. }
  18.  
  19. new const RemoveCmds[][] = {
  20.     "say /alap",
  21.     "say /nincs",
  22.     "say /nohat",
  23.     "say remove"
  24. }
  25.  
  26. enum _:DATA
  27. {
  28.     Name[32],
  29.     Model[32]
  30. }
  31. new sData[DATA]
  32.  
  33. new Trie:SayHats, Array:Hats
  34. new g_HatEnt[33]
  35.  
  36. public plugin_init() {
  37.     register_plugin(Plugin, Version, Author)
  38.    
  39.     for(new i; i<sizeof(MenuCmds);i++)
  40.     {
  41.         #if defined FLAG
  42.         register_clcmd(MenuCmds[i], "Hats_Menu", FLAG)
  43.         #else
  44.         register_clcmd(MenuCmds[i], "Hats_Menu")
  45.         #endif
  46.     }
  47.     for(new i; i<sizeof(RemoveCmds);i++)
  48.     {
  49.         #if defined FLAG
  50.         register_clcmd(RemoveCmds[i], "Remove_Hat", FLAG)
  51.         #else
  52.         register_clcmd(RemoveCmds[i], "Remove_Hat")
  53.         #endif
  54.     }
  55.    
  56.     register_clcmd("say", "sayhandler");
  57.     register_clcmd("say_team", "sayhandler");
  58. }
  59.  
  60. public plugin_precache()
  61. {
  62.     SayHats=TrieCreate()
  63.     Hats=ArrayCreate(DATA)
  64.     new sBuffer[256], sFile[64], pFile
  65.     get_localinfo("amxx_configsdir", sFile, charsmax(sFile))
  66.     format(sFile, charsmax(sFile), "%s/hats.ini", sFile)
  67.    
  68.     pFile = fopen(sFile, "rt")
  69.    
  70.     if(pFile)
  71.     {
  72.         while(!feof(pFile))
  73.         {
  74.             fgets(pFile, sBuffer, charsmax(sBuffer))
  75.             trim(sBuffer)
  76.             if(sBuffer[0] == ';') continue;
  77.            
  78.             parse(sBuffer, sData[Name], 31, sData[Model], 31)
  79.            
  80.             if(containi(sData[Model], ".mdl") && !TrieKeyExists(SayHats, sData[Name]))
  81.             {
  82.                 precache_model(sData[Model])
  83.                 TrieSetString(SayHats, sData[Name], sData[Model])
  84.                 ArrayPushArray(Hats, sData)
  85.             }
  86.         }
  87.         fclose(pFile)
  88.     }
  89.     else write_file(sFile, ";^"hat name^" ^"models/hats_folder/hat_model.mdl^"^n");
  90. }
  91.  
  92. public client_putinserver(id)
  93. {
  94.     if(g_HatEnt[id] > 0) remove_entity(g_HatEnt[id])
  95.     g_HatEnt[id] = 0
  96. }
  97.  
  98. public client_disconnected(id)
  99. {
  100.     if(g_HatEnt[id] > 0) remove_entity(g_HatEnt[id])
  101.     g_HatEnt[id] = 0
  102. }
  103.  
  104. public sayhandler(id)
  105. {
  106.     #if defined FLAG
  107.     if(~get_user_flags(id) & FLAG) return;
  108.     #endif
  109.  
  110.     new message[190]; read_args(message, charsmax(message));
  111.     remove_quotes(message);
  112.    
  113.     if(TrieKeyExists(SayHats, message))
  114.     {
  115.         new sModel[64];
  116.         TrieGetString(SayHats, message, sModel, charsmax(sModel));
  117.         Set_Hat(id, sModel, message);
  118.     }
  119. }
  120.  
  121. public Remove_Hat(id, lvl, cid)
  122. {
  123.     #if defined FLAG
  124.     if(cmd_access(id, lvl, cid, 0))
  125.     {
  126.     #endif
  127.         remove_entity(g_HatEnt[id])
  128.         g_HatEnt[id] = 0
  129.         if(Prefix[0])
  130.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  131.         else
  132.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  133.     #if defined FLAG
  134.     }
  135.     #endif
  136. }
  137.  
  138. public Hats_Menu(id, lvl, cid)
  139. {
  140.     #if defined FLAG
  141.     if(cmd_access(id, lvl, cid, 0))
  142.     {
  143.     #endif
  144.         new txt[128]
  145.         formatex(txt, charsmax(txt), "%s v%s by %s", Plugin, Version, Author)
  146.        
  147.         new menu = menu_create(txt, "Hats_Handler")
  148.        
  149.         menu_additem(menu, "Nincs", "", 0)
  150.         for(new i;i<ArraySize(Hats);i++)
  151.         {
  152.             ArrayGetArray(Hats, i, sData)
  153.             formatex(txt, charsmax(txt), "%s", sData[Name])
  154.            
  155.             menu_additem(menu, txt, "", 0)
  156.         }
  157.        
  158.         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  159.         menu_setprop(menu, MPROP_BACKNAME, "Vissza")
  160.         menu_setprop(menu, MPROP_NEXTNAME, "Következő")
  161.         menu_setprop(menu, MPROP_EXITNAME, "Kilépés")
  162.            
  163.         menu_display(id, menu, 0)
  164.     #if defined FLAG
  165.     }
  166.     #endif
  167. }
  168.  
  169. public Hats_Handler(id, menu, item)
  170. {
  171.     if(item == MENU_EXIT) {
  172.         menu_destroy(menu);
  173.         return PLUGIN_HANDLED;
  174.     }
  175.    
  176.     if(item == 0)
  177.     {
  178.         remove_entity(g_HatEnt[id])
  179.         g_HatEnt[id] = 0
  180.         if(Prefix[0])
  181.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  182.         else
  183.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  184.     }
  185.     else
  186.     {
  187.         ArrayGetArray(Hats, item, sData)
  188.         Set_Hat(id, sData[Model], sData[Name])
  189.     }
  190.     menu_destroy(menu);
  191.     return PLUGIN_HANDLED;
  192. }
  193.  
  194. public Set_Hat(id, model[], name[])
  195. {
  196.     if(g_HatEnt[id] < 1)
  197.     {
  198.         g_HatEnt[id] = create_entity("info_target")
  199.        
  200.         entity_set_string(g_HatEnt[id], EV_SZ_classname, "hat")
  201.         entity_set_edict(g_HatEnt[id], EV_ENT_aiment, id)
  202.         entity_set_edict(g_HatEnt[id], EV_ENT_owner, id)
  203.         entity_set_int(g_HatEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  204.         entity_set_model(g_HatEnt[id], model)
  205.     }
  206.     else
  207.         entity_set_model(g_HatEnt[id], model)
  208.        
  209.     if(Prefix[0])
  210.         client_print_color(id, print_team_default, "^4[%s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Prefix, name)
  211.     else
  212.         client_print_color(0, print_team_default, "^4[%s %s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Plugin, Version, name)
  213.    
  214. }
  215.  
  216. public plugin_end()
  217. {
  218.     ArrayDestroy(Hats)
  219.     TrieDestroy(SayHats)
  220. }
  221. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  222. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  223. */


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája:
HozzászólásElküldve:Ma, 20:19 
Offline
Jómunkásember
Avatar

Csatlakozott:2019.11.03. 22:00
Hozzászólások:415
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 33 alkalommal
saxxo írta:
Csabika20034 írta:
saxxo írta:
Helló!
Miért nem jó ez az útvonal?

Eredeti
  1. ;"hat name" "models/hats_folder/hat_model.mdl"


Általam megadott
  1. "Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"

  1. ;"Captain BaseBall Bat Boy" "models/FTW/Sapka/CaptainBaseBallBat-Boy.mdl"


  1. L 02/28/2026 - 18:58:34: [ENGINE] Entity 0 can not be removed
  2. L 02/28/2026 - 18:58:34: [AMXX] Displaying debug trace (plugin "sapi.amxx", version "1.0")
  3. L 02/28/2026 - 18:58:34: [AMXX] Run time error 10: native error (native "remove_entity")
  4. L 02/28/2026 - 18:58:34: [AMXX]    [0] sapi.sma::Hats_Handler (line 178)



  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4.  
  5. new const Plugin[] = {"Sapik"}
  6. new const Version[] = {"1.0"}
  7. new const Author[] = {"LyleChriss"}
  8.  
  9. new const Prefix[] = {"FTW"}
  10.  
  11. //#define FLAG  ADMIN_KICK
  12.  
  13. new const MenuCmds[][] = {
  14.     "say /sapka",
  15.     "say /sapik",
  16.     "say /sapi"
  17. }
  18.  
  19. new const RemoveCmds[][] = {
  20.     "say /alap",
  21.     "say /nincs",
  22.     "say /nohat",
  23.     "say remove"
  24. }
  25.  
  26. enum _:DATA
  27. {
  28.     Name[32],
  29.     Model[32]
  30. }
  31. new sData[DATA]
  32.  
  33. new Trie:SayHats, Array:Hats
  34. new g_HatEnt[33]
  35.  
  36. public plugin_init() {
  37.     register_plugin(Plugin, Version, Author)
  38.    
  39.     for(new i; i<sizeof(MenuCmds);i++)
  40.     {
  41.         #if defined FLAG
  42.         register_clcmd(MenuCmds[i], "Hats_Menu", FLAG)
  43.         #else
  44.         register_clcmd(MenuCmds[i], "Hats_Menu")
  45.         #endif
  46.     }
  47.     for(new i; i<sizeof(RemoveCmds);i++)
  48.     {
  49.         #if defined FLAG
  50.         register_clcmd(RemoveCmds[i], "Remove_Hat", FLAG)
  51.         #else
  52.         register_clcmd(RemoveCmds[i], "Remove_Hat")
  53.         #endif
  54.     }
  55.    
  56.     register_clcmd("say", "sayhandler");
  57.     register_clcmd("say_team", "sayhandler");
  58. }
  59.  
  60. public plugin_precache()
  61. {
  62.     SayHats=TrieCreate()
  63.     Hats=ArrayCreate(DATA)
  64.     new sBuffer[256], sFile[64], pFile
  65.     get_localinfo("amxx_configsdir", sFile, charsmax(sFile))
  66.     format(sFile, charsmax(sFile), "%s/hats.ini", sFile)
  67.    
  68.     pFile = fopen(sFile, "rt")
  69.    
  70.     if(pFile)
  71.     {
  72.         while(!feof(pFile))
  73.         {
  74.             fgets(pFile, sBuffer, charsmax(sBuffer))
  75.             trim(sBuffer)
  76.             if(sBuffer[0] == ';') continue;
  77.            
  78.             parse(sBuffer, sData[Name], 31, sData[Model], 31)
  79.            
  80.             if(containi(sData[Model], ".mdl") && !TrieKeyExists(SayHats, sData[Name]))
  81.             {
  82.                 precache_model(sData[Model])
  83.                 TrieSetString(SayHats, sData[Name], sData[Model])
  84.                 ArrayPushArray(Hats, sData)
  85.             }
  86.         }
  87.         fclose(pFile)
  88.     }
  89.     else write_file(sFile, ";^"hat name^" ^"models/hats_folder/hat_model.mdl^"^n");
  90. }
  91.  
  92. public client_putinserver(id)
  93. {
  94.     if(g_HatEnt[id] > 0) remove_entity(g_HatEnt[id])
  95.     g_HatEnt[id] = 0
  96. }
  97.  
  98. public client_disconnected(id)
  99. {
  100.     if(g_HatEnt[id] > 0) remove_entity(g_HatEnt[id])
  101.     g_HatEnt[id] = 0
  102. }
  103.  
  104. public sayhandler(id)
  105. {
  106.     #if defined FLAG
  107.     if(~get_user_flags(id) & FLAG) return;
  108.     #endif
  109.  
  110.     new message[190]; read_args(message, charsmax(message));
  111.     remove_quotes(message);
  112.    
  113.     if(TrieKeyExists(SayHats, message))
  114.     {
  115.         new sModel[64];
  116.         TrieGetString(SayHats, message, sModel, charsmax(sModel));
  117.         Set_Hat(id, sModel, message);
  118.     }
  119. }
  120.  
  121. public Remove_Hat(id, lvl, cid)
  122. {
  123.     #if defined FLAG
  124.     if(cmd_access(id, lvl, cid, 0))
  125.     {
  126.     #endif
  127.         remove_entity(g_HatEnt[id])
  128.         g_HatEnt[id] = 0
  129.         if(Prefix[0])
  130.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  131.         else
  132.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  133.     #if defined FLAG
  134.     }
  135.     #endif
  136. }
  137.  
  138. public Hats_Menu(id, lvl, cid)
  139. {
  140.     #if defined FLAG
  141.     if(cmd_access(id, lvl, cid, 0))
  142.     {
  143.     #endif
  144.         new txt[128]
  145.         formatex(txt, charsmax(txt), "%s v%s by %s", Plugin, Version, Author)
  146.        
  147.         new menu = menu_create(txt, "Hats_Handler")
  148.        
  149.         menu_additem(menu, "Nincs", "", 0)
  150.         for(new i;i<ArraySize(Hats);i++)
  151.         {
  152.             ArrayGetArray(Hats, i, sData)
  153.             formatex(txt, charsmax(txt), "%s", sData[Name])
  154.            
  155.             menu_additem(menu, txt, "", 0)
  156.         }
  157.        
  158.         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  159.         menu_setprop(menu, MPROP_BACKNAME, "Vissza")
  160.         menu_setprop(menu, MPROP_NEXTNAME, "Következő")
  161.         menu_setprop(menu, MPROP_EXITNAME, "Kilépés")
  162.            
  163.         menu_display(id, menu, 0)
  164.     #if defined FLAG
  165.     }
  166.     #endif
  167. }
  168.  
  169. public Hats_Handler(id, menu, item)
  170. {
  171.     if(item == MENU_EXIT) {
  172.         menu_destroy(menu);
  173.         return PLUGIN_HANDLED;
  174.     }
  175.    
  176.     if(item == 0)
  177.     {
  178.         remove_entity(g_HatEnt[id])
  179.         g_HatEnt[id] = 0
  180.         if(Prefix[0])
  181.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  182.         else
  183.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  184.     }
  185.     else
  186.     {
  187.         ArrayGetArray(Hats, item, sData)
  188.         Set_Hat(id, sData[Model], sData[Name])
  189.     }
  190.     menu_destroy(menu);
  191.     return PLUGIN_HANDLED;
  192. }
  193.  
  194. public Set_Hat(id, model[], name[])
  195. {
  196.     if(g_HatEnt[id] < 1)
  197.     {
  198.         g_HatEnt[id] = create_entity("info_target")
  199.        
  200.         entity_set_string(g_HatEnt[id], EV_SZ_classname, "hat")
  201.         entity_set_edict(g_HatEnt[id], EV_ENT_aiment, id)
  202.         entity_set_edict(g_HatEnt[id], EV_ENT_owner, id)
  203.         entity_set_int(g_HatEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  204.         entity_set_model(g_HatEnt[id], model)
  205.     }
  206.     else
  207.         entity_set_model(g_HatEnt[id], model)
  208.        
  209.     if(Prefix[0])
  210.         client_print_color(id, print_team_default, "^4[%s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Prefix, name)
  211.     else
  212.         client_print_color(0, print_team_default, "^4[%s %s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Plugin, Version, name)
  213.    
  214. }
  215.  
  216. public plugin_end()
  217. {
  218.     ArrayDestroy(Hats)
  219.     TrieDestroy(SayHats)
  220. }
  221. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  222. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  223. */


  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4.  
  5. new const Plugin[] = {"Sapik"}
  6. new const Version[] = {"1.0"}
  7. new const Author[] = {"LyleChriss"}
  8.  
  9. new const Prefix[] = {"FTW"}
  10.  
  11. //#define FLAG  ADMIN_KICK
  12.  
  13. new const MenuCmds[][] = {
  14.     "say /sapka",
  15.     "say /sapik",
  16.     "say /sapi"
  17. }
  18.  
  19. new const RemoveCmds[][] = {
  20.     "say /alap",
  21.     "say /nincs",
  22.     "say /nohat",
  23.     "say remove"
  24. }
  25.  
  26. enum _:DATA
  27. {
  28.     Name[32],
  29.     Model[32]
  30. }
  31. new sData[DATA]
  32.  
  33. new Trie:SayHats, Array:Hats
  34. new g_HatEnt[33]
  35.  
  36. public plugin_init() {
  37.     register_plugin(Plugin, Version, Author)
  38.    
  39.     for(new i; i<sizeof(MenuCmds);i++)
  40.     {
  41.         #if defined FLAG
  42.         register_clcmd(MenuCmds[i], "Hats_Menu", FLAG)
  43.         #else
  44.         register_clcmd(MenuCmds[i], "Hats_Menu")
  45.         #endif
  46.     }
  47.     for(new i; i<sizeof(RemoveCmds);i++)
  48.     {
  49.         #if defined FLAG
  50.         register_clcmd(RemoveCmds[i], "Remove_Hat", FLAG)
  51.         #else
  52.         register_clcmd(RemoveCmds[i], "Remove_Hat")
  53.         #endif
  54.     }
  55.    
  56.     register_clcmd("say", "sayhandler");
  57.     register_clcmd("say_team", "sayhandler");
  58. }
  59.  
  60. public plugin_precache()
  61. {
  62.     SayHats=TrieCreate()
  63.     Hats=ArrayCreate(DATA)
  64.     new sBuffer[256], sFile[64], pFile
  65.     get_localinfo("amxx_configsdir", sFile, charsmax(sFile))
  66.     format(sFile, charsmax(sFile), "%s/hats.ini", sFile)
  67.    
  68.     pFile = fopen(sFile, "rt")
  69.    
  70.     if(pFile)
  71.     {
  72.         while(!feof(pFile))
  73.         {
  74.             fgets(pFile, sBuffer, charsmax(sBuffer))
  75.             trim(sBuffer)
  76.             if(sBuffer[0] == ';') continue;
  77.            
  78.             parse(sBuffer, sData[Name], 31, sData[Model], 31)
  79.            
  80.             if(containi(sData[Model], ".mdl") && !TrieKeyExists(SayHats, sData[Name]))
  81.             {
  82.                 precache_model(sData[Model])
  83.                 TrieSetString(SayHats, sData[Name], sData[Model])
  84.                 ArrayPushArray(Hats, sData)
  85.             }
  86.         }
  87.         fclose(pFile)
  88.     }
  89.     else write_file(sFile, ";^"hat name^" ^"models/hats_folder/hat_model.mdl^"^n");
  90. }
  91.  
  92. public client_putinserver(id)
  93. {
  94.     if(g_HatEnt[id] > 0 && is_valid_ent(g_HatEnt[id]))
  95.         remove_entity(g_HatEnt[id])
  96.  
  97.     g_HatEnt[id] = 0
  98. }
  99.  
  100. public client_disconnected(id)
  101. {
  102.     if(g_HatEnt[id] > 0 && is_valid_ent(g_HatEnt[id]))
  103.         remove_entity(g_HatEnt[id])
  104.  
  105.     g_HatEnt[id] = 0
  106. }
  107.  
  108. public sayhandler(id)
  109. {
  110.     #if defined FLAG
  111.     if(~get_user_flags(id) & FLAG) return;
  112.     #endif
  113.  
  114.     new message[190]; read_args(message, charsmax(message));
  115.     remove_quotes(message);
  116.    
  117.     if(TrieKeyExists(SayHats, message))
  118.     {
  119.         new sModel[64];
  120.         TrieGetString(SayHats, message, sModel, charsmax(sModel));
  121.         Set_Hat(id, sModel, message);
  122.     }
  123. }
  124.  
  125. public Remove_Hat(id, lvl, cid)
  126. {
  127.     #if defined FLAG
  128.     if(cmd_access(id, lvl, cid, 0))
  129.     {
  130.     #endif
  131.  
  132.         if(g_HatEnt[id] > 0 && is_valid_ent(g_HatEnt[id]))
  133.             remove_entity(g_HatEnt[id])
  134.  
  135.         g_HatEnt[id] = 0
  136.  
  137.         if(Prefix[0])
  138.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  139.         else
  140.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  141.  
  142.     #if defined FLAG
  143.     }
  144.     #endif
  145. }
  146.  
  147. public Hats_Menu(id, lvl, cid)
  148. {
  149.     #if defined FLAG
  150.     if(cmd_access(id, lvl, cid, 0))
  151.     {
  152.     #endif
  153.  
  154.         new txt[128]
  155.         formatex(txt, charsmax(txt), "%s v%s by %s", Plugin, Version, Author)
  156.        
  157.         new menu = menu_create(txt, "Hats_Handler")
  158.        
  159.         menu_additem(menu, "Nincs", "", 0)
  160.         for(new i;i<ArraySize(Hats);i++)
  161.         {
  162.             ArrayGetArray(Hats, i, sData)
  163.             formatex(txt, charsmax(txt), "%s", sData[Name])
  164.            
  165.             menu_additem(menu, txt, "", 0)
  166.         }
  167.        
  168.         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  169.         menu_setprop(menu, MPROP_BACKNAME, "Vissza")
  170.         menu_setprop(menu, MPROP_NEXTNAME, "Következő")
  171.         menu_setprop(menu, MPROP_EXITNAME, "Kilépés")
  172.            
  173.         menu_display(id, menu, 0)
  174.  
  175.     #if defined FLAG
  176.     }
  177.     #endif
  178. }
  179.  
  180. public Hats_Handler(id, menu, item)
  181. {
  182.     if(item == MENU_EXIT) {
  183.         menu_destroy(menu);
  184.         return PLUGIN_HANDLED;
  185.     }
  186.    
  187.     if(item == 0)
  188.     {
  189.         if(g_HatEnt[id] > 0 && is_valid_ent(g_HatEnt[id]))
  190.             remove_entity(g_HatEnt[id])
  191.  
  192.         g_HatEnt[id] = 0
  193.  
  194.         if(Prefix[0])
  195.             client_print_color(id, print_team_default, "^4[%s]^1 Törölted a sapkád.", Prefix)
  196.         else
  197.             client_print_color(0, print_team_default, "^4[%s %s]^1 Törölted a sapkád.", Plugin, Version)
  198.     }
  199.     else
  200.     {
  201.         ArrayGetArray(Hats, item, sData)
  202.         Set_Hat(id, sData[Model], sData[Name])
  203.     }
  204.  
  205.     menu_destroy(menu);
  206.     return PLUGIN_HANDLED;
  207. }
  208.  
  209. public Set_Hat(id, model[], name[])
  210. {
  211.     if(g_HatEnt[id] < 1 || !is_valid_ent(g_HatEnt[id]))
  212.     {
  213.         g_HatEnt[id] = create_entity("info_target")
  214.        
  215.         entity_set_string(g_HatEnt[id], EV_SZ_classname, "hat")
  216.         entity_set_edict(g_HatEnt[id], EV_ENT_aiment, id)
  217.         entity_set_edict(g_HatEnt[id], EV_ENT_owner, id)
  218.         entity_set_int(g_HatEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  219.         entity_set_model(g_HatEnt[id], model)
  220.     }
  221.     else
  222.         entity_set_model(g_HatEnt[id], model)
  223.        
  224.     if(Prefix[0])
  225.         client_print_color(id, print_team_default, "^4[%s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Prefix, name)
  226.     else
  227.         client_print_color(0, print_team_default, "^4[%s %s]^1 kiválasztottad a(z) ^3%s ^1sapkát.", Plugin, Version, name)
  228. }
  229.  
  230. public plugin_end()
  231. {
  232.     ArrayDestroy(Hats)
  233.     TrieDestroy(SayHats)
  234. }

_________________
BiG BrotherZ AWP
IP >awp.bigbrotherz.hu:27075


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


Ki van itt

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