hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.06. 12:18



Jelenlévő felhasználók

Jelenleg 518 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 518 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: (Megoldva) Hiányzó Hud rangrendszerhez
HozzászólásElküldve: 2019.12.24. 14:46 
Offline
Fanatikus

Csatlakozott: 2019.12.06. 20:00
Hozzászólások: 158
Megköszönt másnak: 13 alkalommal
Üdv.

Valaki megtudná nekem oldani hogy benne lenne a hud rendszer ?


Ölések : 1
Rangod: Unraked
Parancsok: /hud /rang

Valaki ezeket megtudná valósítani. ?

  1. . #include <amxmodx>
  2.     #include <amxmisc>
  3.     #include <ColorChat>
  4.     #include <engine>
  5.     #include <cstrike>
  6.     #include <sqlx>
  7.      
  8.     #pragma tabsize 0
  9.      
  10.     #define TULAJ ADMIN_IMMUNITY
  11.     #define ADMIN ADMIN_LEVEL_E
  12.     #define FOADMIN ADMIN_LEVEL_B
  13.     #define KISADMIN ADMIN_BAN
  14.      
  15.     #define ASD 15
  16.      
  17.     //SQL MENTÉS/REGRENDSZER
  18.    
  19.      
  20.     new Handle:g_SqlTuple;
  21.      
  22.     new PLUGIN[] = "Rangok";
  23.     new VERSION[] = "0.1.0";
  24.     new AUTHOR[] = "asdasdasd";
  25.      
  26.      
  27.     new PREFIX[] = "Chat Prefix";
  28.      
  29.     new olesek[33], szint[33];
  30.      
  31.     //**Chat is exodus chatje**//
  32.     new Temp[192];
  33.      
  34.      
  35.     new const szamok[ASD] = {
  36.     100,
  37.     300,
  38.     550,
  39.     1000,
  40.     2000,
  41.     4000,
  42.     5000,
  43.     6000,
  44.     7000,
  45.     8000,
  46.     10000,
  47.     12000,
  48.     15000,
  49.     18000,
  50.     22000
  51.      
  52.     }
  53.      
  54.     new const rangok[ASD+1][] = {
  55.     "Ăšjonc(1)",
  56.     "HonvĂ©d(2)",
  57.     "ŐrvezetĹ‘(3)",
  58.     "Tizedes(4)",
  59.     "SzakaszvezetĹ‘(5)",
  60.     "Őrmester(6)",
  61.     "Hadnagy(7)",
  62.     "FĹ‘hadnagy(8)",
  63.     "Százados(9)",
  64.     "Őrnagy(10)",
  65.     "Alezredes(11)",
  66.     "Ezredes(12)",
  67.     "Dandártábornok(13)",
  68.     "VezĂ©rnagy(14)",
  69.     "Altábornok(15)",
  70.     "VezĂ©rezredes(16)"
  71.      
  72.     }
  73.     public plugin_init()
  74.     {
  75.      
  76.     register_plugin(PLUGIN, VERSION, AUTHOR)
  77.     //Parancsok
  78.     register_clcmd("say /rang", "showrang");
  79.      
  80.     //Event
  81.     register_event("DeathMsg", "halal", "a")
  82.      
  83.        
  84.     //Ha valamelyik betűre szeretnéd a menüt, akkor csak vedd el a --> // - jelet
  85.        
  86.     //**FONTOS!**//(maradjon alul)
  87.     register_clcmd("say", "sayhook");
  88.     }
  89.     public halal(id)
  90.     {
  91.     new killer = read_data(1);
  92.     new victim = read_data(2);
  93.        
  94.        
  95.     if(killer != victim)
  96.     olesek[killer]++
  97.        
  98.     while(olesek[killer] >= szamok[szint[killer]])
  99.     {
  100.     szint[killer]++
  101.     }
  102.     }
  103.     public showrang(id)
  104.     {
  105.     if(szint[id] != ASD+1)
  106.     {
  107.     ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d ^1| ^3Kell mĂ©g: ^4%d", PREFIX, rangok[szint[id]], olesek[id], szamok[szint[id]]-olesek[id]);
  108.     }
  109.     else
  110.     {
  111.     ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d", PREFIX, rangok[szint[id]], olesek[id]);
  112.     ColorChat(id, GREEN, "^4[%s] ^1ElĂ©rted a legmagasabb ^3Rangot.", PREFIX);
  113.     }
  114.     return PLUGIN_HANDLED;
  115.     }
  116.      
  117.     public plugin_cfg()
  118.     {
  119.     g_SqlTuple = SQL_MakeDbTuple(SQLINFO[0], SQLINFO[1], SQLINFO[2], SQLINFO[3])
  120.     static Query[10048]
  121.     new Len
  122.     Len += formatex(Query[Len], charsmax(Query), "CREATE TABLE IF NOT EXISTS `rangrendszer`")
  123.     Len += formatex(Query[Len], charsmax(Query)-Len, "(`Steamid` varchar(32) NOT NULL, ")
  124.     Len += formatex(Query[Len], charsmax(Query)-Len, "`olesek` int(11) NOT NULL,")
  125.     Len += formatex(Query[Len], charsmax(Query)-Len, "`szint` int(11) NOT NULL,")
  126.      
  127.     Len += formatex(Query[Len], charsmax(Query)-Len, "`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY)")
  128.     SQL_ThreadQuery(g_SqlTuple, "createTableThread", Query)
  129.     }
  130.     public Load(id) {
  131.     static Query[10048]
  132.     new Data[1], Steam[32]
  133.     get_user_authid(id, Steam, 31)
  134.     Data[0] = id
  135.     formatex(Query, charsmax(Query), "SELECT * FROM `rangrendszer` WHERE Steamid = ^"%s^";", Steam)
  136.     SQL_ThreadQuery(g_SqlTuple, "QuerySelectData", Query, Data, 1)
  137.     }
  138.     public QuerySelectData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  139.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  140.     log_amx("%s", Error)
  141.     return
  142.     }
  143.     else {
  144.     new id = Data[0];
  145.     if(SQL_NumRows(Query) > 0)
  146.     {
  147.     olesek[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "olesek"))
  148.     szint[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "szint"))
  149.      
  150.     }
  151.     else
  152.     {
  153.       Save(id)
  154.     }
  155.     }
  156.     }
  157.     public Save(id)
  158.     {
  159.     static Query[256]
  160.     new Steam[32]; get_user_authid(id, Steam, 31)
  161.     formatex(Query, charsmax(Query), "INSERT INTO `rangrendszer` (`Steamid`) VALUES (^"%s^");", Steam)
  162.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  163.     }
  164.     public Update(id)
  165.     {
  166.     static Query[10048]
  167.     new Len
  168.     new Steam[32]; get_user_authid(id, Steam, 31)
  169.     Len += formatex(Query[Len], charsmax(Query), "UPDATE `rangrendszer` SET olesek = ^"%i^", ", olesek[id])
  170.      
  171.             Len += formatex(Query[Len], charsmax(Query)-Len, "szint = ^"%i^" WHERE Steamid = ^"%s^";", szint[id], Steam)
  172.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  173.     }
  174.     public createTableThread(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  175.     if(FailState == TQUERY_CONNECT_FAILED)
  176.     set_fail_state("[HIBA*] NEM TUDTAM CSATLAKOZNI AZ ADATBAZISHOZ!")
  177.     else if(FailState == TQUERY_QUERY_FAILED)
  178.     set_fail_state("Query Error")
  179.     if(Errcode)
  180.     log_amx("[HIBA*] HIBAT DOBTAM: %s",Error)
  181.     }
  182.     public QuerySetData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  183.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  184.     log_amx("%s", Error);
  185.     return;
  186.     }
  187.     }
  188.     public client_putinserver(id)
  189.     {
  190.      
  191.     if(!is_user_bot(id))
  192.     Load(id);
  193.     return PLUGIN_CONTINUE
  194.     }
  195.     public client_disconnect(id)
  196.     {
  197.     if(!is_user_bot(id))
  198.     {
  199.        Update(id)
  200.     }
  201.     olesek[id] = 0
  202.     szint[id] = 0
  203.        
  204.     }
  205.      
  206.     public sayhook(id)
  207.     {
  208.     new message[192], nev[32], none[2][32], chat[192];
  209.     read_args(message, 191);
  210.     remove_quotes(message);
  211.        
  212.     formatex(none[0], 31, ""), formatex(none[1], 31, " ");
  213.        
  214.     if (message[0] == '@' || message[0] == '/' || message[0] == '#' || message[0] == '!' || equal (message, ""))
  215.     return PLUGIN_HANDLED;
  216.        
  217.     if(!equali(message, none[0]) && !equali(message, none[1]))
  218.     {
  219.     get_user_name(id, nev, 31);
  220.     if(is_user_alive(id))
  221.     {
  222.     if(get_user_flags(id) & TULAJ)
  223.     formatex(chat, 191, "^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  224.     else if(get_user_flags(id) & FOADMIN)
  225.     formatex(chat, 191, "^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  226.     else if(get_user_flags(id) & ADMIN)
  227.     formatex(chat, 191, "^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  228.     else if(get_user_flags(id) & KISADMIN)
  229.     formatex(chat, 191, "^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  230.     else
  231.     formatex(chat, 191, "^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  232.     }
  233.     else {
  234.        
  235.     if(get_user_flags(id) & TULAJ)
  236.     formatex(chat, 191, "^x01*Halott*^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  237.     else if(get_user_flags(id) & FOADMIN)
  238.     formatex(chat, 191, "^x01*Halott*^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  239.     else if(get_user_flags(id) & ADMIN)
  240.     formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  241.     else if(get_user_flags(id) & ADMIN)
  242.     formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  243.     else if(get_user_flags(id) & KISADMIN)
  244.     formatex(chat, 191, "^x01*Halott*^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  245.     else
  246.     formatex(chat, 191, "^x01*Halott*^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  247.     }
  248.        
  249.        
  250.     switch(cs_get_user_team(id)) //Prefix
  251.     {
  252.     case 1: ColorChat(0, RED, chat);
  253.     case 2: ColorChat(0, BLUE, chat);
  254.     }
  255.     if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  256.     ColorChat(0, GREY, chat);
  257.     return PLUGIN_HANDLED;
  258.     }
  259.     return PLUGIN_CONTINUE;
  260.     }
  261.     public sendmessage(color[])
  262.     {
  263.     new teamName[10];
  264.     for(new player = 1; player < get_maxplayers(); player++)
  265.     {
  266.     get_user_team (player, teamName, 9);
  267.     teamf (player, color);
  268.     elkuldes(player, Temp);
  269.     teamf(player, teamName);
  270.     }
  271.     }
  272.     public teamf(player, team[])
  273.     {
  274.     message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player);
  275.     write_byte(player);
  276.     write_string(team);
  277.     message_end();
  278.     }
  279.     public elkuldes(player, Temp[])
  280.     {
  281.     message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, player);
  282.     write_byte( player );
  283.     write_string( Temp );
  284.     message_end();
  285.     }
  286.     public plugin_end()
  287.     {
  288.     SQL_FreeHandle(g_SqlTuple);
  289.     }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Hiányzó Hud
HozzászólásElküldve: 2019.12.24. 17:17 
Offline
Senior Tag
Avatar

Csatlakozott: 2017.08.09. 17:01
Hozzászólások: 266
Megköszönt másnak: 61 alkalommal
Megköszönték neki: 72 alkalommal
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <ColorChat>
  4. #include <engine>
  5. #include <cstrike>
  6. #include <sqlx>
  7.  
  8. #pragma tabsize 0
  9.  
  10. #define TULAJ ADMIN_IMMUNITY
  11. #define ADMIN ADMIN_LEVEL_E
  12. #define FOADMIN ADMIN_LEVEL_B
  13. #define KISADMIN ADMIN_BAN
  14.  
  15. #define ASD 15
  16.  
  17. //SQL MENTÉS/REGRENDSZER
  18. new const SQLINFO[][] = { "Kiszolgalo", "Felhasznalo", "Jelszo", "Adatbazis" };
  19.  
  20. new Handle:g_SqlTuple;
  21.  
  22. new PLUGIN[] = "Rangok";
  23. new VERSION[] = "0.1.0";
  24. new AUTHOR[] = "asdasdasd";
  25. new hudkibe[33];
  26.  
  27. new PREFIX[] = "Chat Prefix";
  28.  
  29. new olesek[33], szint[33];
  30.  
  31. //**Chat is exodus chatje**//
  32. new Temp[192];
  33.  
  34.  
  35. new const szamok[ASD] = {
  36.     100,
  37.     300,
  38.     550,
  39.     1000,
  40.     2000,
  41.     4000,
  42.     5000,
  43.     6000,
  44.     7000,
  45.     8000,
  46.     10000,
  47.     12000,
  48.     15000,
  49.     18000,
  50.     22000
  51.    
  52. }
  53.  
  54. new const rangok[ASD+1][] = {
  55.     "Ăšjonc(1)",
  56.     "HonvĂ©d(2)",
  57.     "ŐrvezetĹ‘(3)",
  58.     "Tizedes(4)",
  59.     "SzakaszvezetĹ‘(5)",
  60.     "Őrmester(6)",
  61.     "Hadnagy(7)",
  62.     "FĹ‘hadnagy(8)",
  63.     "Százados(9)",
  64.     "Őrnagy(10)",
  65.     "Alezredes(11)",
  66.     "Ezredes(12)",
  67.     "Dandártábornok(13)",
  68.     "VezĂ©rnagy(14)",
  69.     "Altábornok(15)",
  70.     "VezĂ©rezredes(16)"
  71.    
  72. }
  73. public plugin_init()
  74. {
  75.    
  76.     register_plugin(PLUGIN, VERSION, AUTHOR)
  77.     //Parancsok
  78.     register_clcmd("say /rang", "showrang");
  79.     register_clcmd("say /hud", "hudkibekapcs");
  80.    
  81.     //Event
  82.     register_event("DeathMsg", "halal", "a")
  83.    
  84.     //Ha valamelyik betűre szeretnéd a menüt, akkor csak vedd el a --> // - jelet
  85.    
  86.     //**FONTOS!**//(maradjon alul)
  87.     register_clcmd("say", "sayhook");
  88. }
  89. public hudrendszer(id)
  90. {
  91.     if(!hudkibe[id])
  92.         return;
  93.     if(is_user_alive(id))
  94.     {
  95.         set_hudmessage(0, 255, 0, 0.07, 0.14, 0, 6.0, 12.0)
  96.         show_hudmessage(id, "Ă–lĂ©sek: %d^nRangod: %s^nParancsok: /rang, /hud", olesek[id], rangok[szint[id]]);
  97.     }
  98. }
  99. public hudkibekapcs(id)
  100. {
  101.     if(hudkibe[id])
  102.     {
  103.         ColorChat(id, GREEN, "^4[%s] ^1Kikapcsoltad a hudot.", PREFIX);
  104.         hudkibe[id] = false;
  105.     }
  106.     else
  107.     {
  108.         ColorChat(id, GREEN, "^4[%s] ^1Bekapcsoltad a hudot.", PREFIX);
  109.         hudkibe[id] = true;
  110.     }
  111. }
  112. public halal(id)
  113. {
  114.     new killer = read_data(1);
  115.     new victim = read_data(2);
  116.    
  117.    
  118.     if(killer != victim)
  119.         olesek[killer]++
  120.    
  121.     while(olesek[killer] >= szamok[szint[killer]])
  122.     {
  123.         szint[killer]++
  124.     }
  125. }
  126. public showrang(id)
  127. {
  128.     if(szint[id] != ASD+1)
  129.     {
  130.         ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d ^1| ^3Kell mĂ©g: ^4%d", PREFIX, rangok[szint[id]], olesek[id], szamok[szint[id]]-olesek[id]);
  131.     }
  132.     else
  133.     {
  134.         ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d", PREFIX, rangok[szint[id]], olesek[id]);
  135.         ColorChat(id, GREEN, "^4[%s] ^1ElĂ©rted a legmagasabb ^3Rangot.", PREFIX);
  136.     }
  137.     return PLUGIN_HANDLED;
  138. }
  139.  
  140. public plugin_cfg()
  141. {
  142.     g_SqlTuple = SQL_MakeDbTuple(SQLINFO[0], SQLINFO[1], SQLINFO[2], SQLINFO[3])
  143.     static Query[10048]
  144.     new Len
  145.     Len += formatex(Query[Len], charsmax(Query), "CREATE TABLE IF NOT EXISTS `rangrendszer`")
  146.     Len += formatex(Query[Len], charsmax(Query)-Len, "(`Steamid` varchar(32) NOT NULL, ")
  147.     Len += formatex(Query[Len], charsmax(Query)-Len, "`olesek` int(11) NOT NULL,")
  148.     Len += formatex(Query[Len], charsmax(Query)-Len, "`szint` int(11) NOT NULL,")
  149.    
  150.     Len += formatex(Query[Len], charsmax(Query)-Len, "`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY)")
  151.     SQL_ThreadQuery(g_SqlTuple, "createTableThread", Query)
  152. }
  153. public Load(id) {
  154.     static Query[10048]
  155.     new Data[1], Steam[32]
  156.     get_user_authid(id, Steam, 31)
  157.     Data[0] = id
  158.     formatex(Query, charsmax(Query), "SELECT * FROM `rangrendszer` WHERE Steamid = ^"%s^";", Steam)
  159.     SQL_ThreadQuery(g_SqlTuple, "QuerySelectData", Query, Data, 1)
  160. }
  161. public QuerySelectData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  162.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  163.         log_amx("%s", Error)
  164.         return
  165.     }
  166.     else {
  167.         new id = Data[0];
  168.         if(SQL_NumRows(Query) > 0)
  169.         {
  170.             olesek[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "olesek"))
  171.             szint[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "szint"))
  172.            
  173.         }
  174.         else
  175.         {
  176.             Save(id)
  177.         }
  178.     }
  179. }
  180. public Save(id)
  181. {
  182.     static Query[256]
  183.     new Steam[32]; get_user_authid(id, Steam, 31)
  184.     formatex(Query, charsmax(Query), "INSERT INTO `rangrendszer` (`Steamid`) VALUES (^"%s^");", Steam)
  185.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  186. }
  187. public Update(id)
  188. {
  189.     static Query[10048]
  190.     new Len
  191.     new Steam[32]; get_user_authid(id, Steam, 31)
  192.     Len += formatex(Query[Len], charsmax(Query), "UPDATE `rangrendszer` SET olesek = ^"%i^", ", olesek[id])
  193.    
  194.     Len += formatex(Query[Len], charsmax(Query)-Len, "szint = ^"%i^" WHERE Steamid = ^"%s^";", szint[id], Steam)
  195.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  196. }
  197. public createTableThread(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  198.     if(FailState == TQUERY_CONNECT_FAILED)
  199.         set_fail_state("[HIBA*] NEM TUDTAM CSATLAKOZNI AZ ADATBAZISHOZ!")
  200.     else if(FailState == TQUERY_QUERY_FAILED)
  201.         set_fail_state("Query Error")
  202.     if(Errcode)
  203.         log_amx("[HIBA*] HIBAT DOBTAM: %s",Error)
  204. }
  205. public QuerySetData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  206.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  207.         log_amx("%s", Error);
  208.         return;
  209.     }
  210. }
  211. public client_putinserver(id)
  212. {
  213.    
  214.     if(!is_user_bot(id))
  215.     {
  216.         Load(id);
  217.     }
  218.     hudkibe[id] = true;
  219.     set_task(1.0, "hudrendszer", id, _, _, "b");
  220.     return PLUGIN_CONTINUE
  221. }
  222. public client_disconnect(id)
  223. {
  224.     if(!is_user_bot(id))
  225.     {
  226.         Update(id)
  227.     }
  228.     olesek[id] = 0
  229.     szint[id] = 0
  230.     hudkibe[id] = true;
  231.    
  232. }
  233.  
  234. public sayhook(id)
  235. {
  236.     new message[192], nev[32], none[2][32], chat[192];
  237.     read_args(message, 191);
  238.     remove_quotes(message);
  239.    
  240.     formatex(none[0], 31, ""), formatex(none[1], 31, " ");
  241.    
  242.     if (message[0] == '@' || message[0] == '/' || message[0] == '#' || message[0] == '!' || equal (message, ""))
  243.         return PLUGIN_HANDLED;
  244.    
  245.     if(!equali(message, none[0]) && !equali(message, none[1]))
  246.     {
  247.         get_user_name(id, nev, 31);
  248.         if(is_user_alive(id))
  249.         {
  250.             if(get_user_flags(id) & TULAJ)
  251.                 formatex(chat, 191, "^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  252.             else if(get_user_flags(id) & FOADMIN)
  253.                 formatex(chat, 191, "^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  254.             else if(get_user_flags(id) & ADMIN)
  255.                 formatex(chat, 191, "^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  256.             else if(get_user_flags(id) & KISADMIN)
  257.                 formatex(chat, 191, "^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  258.             else
  259.                 formatex(chat, 191, "^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  260.         }
  261.         else {
  262.            
  263.             if(get_user_flags(id) & TULAJ)
  264.                 formatex(chat, 191, "^x01*Halott*^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  265.             else if(get_user_flags(id) & FOADMIN)
  266.                 formatex(chat, 191, "^x01*Halott*^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  267.             else if(get_user_flags(id) & ADMIN)
  268.                 formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  269.             else if(get_user_flags(id) & ADMIN)
  270.                 formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  271.             else if(get_user_flags(id) & KISADMIN)
  272.                 formatex(chat, 191, "^x01*Halott*^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  273.             else
  274.                 formatex(chat, 191, "^x01*Halott*^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  275.         }
  276.        
  277.        
  278.         switch(cs_get_user_team(id)) //Prefix
  279.         {
  280.             case 1: ColorChat(0, RED, chat);
  281.                 case 2: ColorChat(0, BLUE, chat);
  282.             }
  283.         if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  284.             ColorChat(0, GREY, chat);
  285.         return PLUGIN_HANDLED;
  286.     }
  287.     return PLUGIN_CONTINUE;
  288. }
  289. public sendmessage(color[])
  290. {
  291.     new teamName[10];
  292.     for(new player = 1; player < get_maxplayers(); player++)
  293.     {
  294.         get_user_team (player, teamName, 9);
  295.         teamf (player, color);
  296.         elkuldes(player, Temp);
  297.         teamf(player, teamName);
  298.     }
  299. }
  300. public teamf(player, team[])
  301. {
  302.     message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player);
  303.     write_byte(player);
  304.     write_string(team);
  305.     message_end();
  306. }
  307. public elkuldes(player, Temp[])
  308. {
  309.     message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, player);
  310.     write_byte( player );
  311.     write_string( Temp );
  312.     message_end();
  313. }
  314. public plugin_end()
  315. {
  316.     SQL_FreeHandle(g_SqlTuple);
  317. }

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 1300 bytes
Code size: 11124 bytes
Data size: 128952 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 157760 bytes
Done.


Próbáld.
Teszteltem, nekem jó volt.

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


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Hiányzó Hud
HozzászólásElküldve: 2019.12.25. 09:28 
Offline
Fanatikus

Csatlakozott: 2019.12.06. 20:00
Hozzászólások: 158
Megköszönt másnak: 13 alkalommal
HellEnergY írta:
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <ColorChat>
  4. #include <engine>
  5. #include <cstrike>
  6. #include <sqlx>
  7.  
  8. #pragma tabsize 0
  9.  
  10. #define TULAJ ADMIN_IMMUNITY
  11. #define ADMIN ADMIN_LEVEL_E
  12. #define FOADMIN ADMIN_LEVEL_B
  13. #define KISADMIN ADMIN_BAN
  14.  
  15. #define ASD 15
  16.  
  17. //SQL MENTÉS/REGRENDSZER
  18. new const SQLINFO[][] = { "Kiszolgalo", "Felhasznalo", "Jelszo", "Adatbazis" };
  19.  
  20. new Handle:g_SqlTuple;
  21.  
  22. new PLUGIN[] = "Rangok";
  23. new VERSION[] = "0.1.0";
  24. new AUTHOR[] = "asdasdasd";
  25. new hudkibe[33];
  26.  
  27. new PREFIX[] = "Chat Prefix";
  28.  
  29. new olesek[33], szint[33];
  30.  
  31. //**Chat is exodus chatje**//
  32. new Temp[192];
  33.  
  34.  
  35. new const szamok[ASD] = {
  36.     100,
  37.     300,
  38.     550,
  39.     1000,
  40.     2000,
  41.     4000,
  42.     5000,
  43.     6000,
  44.     7000,
  45.     8000,
  46.     10000,
  47.     12000,
  48.     15000,
  49.     18000,
  50.     22000
  51.    
  52. }
  53.  
  54. new const rangok[ASD+1][] = {
  55.     "Ăšjonc(1)",
  56.     "HonvĂ©d(2)",
  57.     "ŐrvezetĹ‘(3)",
  58.     "Tizedes(4)",
  59.     "SzakaszvezetĹ‘(5)",
  60.     "Őrmester(6)",
  61.     "Hadnagy(7)",
  62.     "FĹ‘hadnagy(8)",
  63.     "Százados(9)",
  64.     "Őrnagy(10)",
  65.     "Alezredes(11)",
  66.     "Ezredes(12)",
  67.     "Dandártábornok(13)",
  68.     "VezĂ©rnagy(14)",
  69.     "Altábornok(15)",
  70.     "VezĂ©rezredes(16)"
  71.    
  72. }
  73. public plugin_init()
  74. {
  75.    
  76.     register_plugin(PLUGIN, VERSION, AUTHOR)
  77.     //Parancsok
  78.     register_clcmd("say /rang", "showrang");
  79.     register_clcmd("say /hud", "hudkibekapcs");
  80.    
  81.     //Event
  82.     register_event("DeathMsg", "halal", "a")
  83.    
  84.     //Ha valamelyik betűre szeretnéd a menüt, akkor csak vedd el a --> // - jelet
  85.    
  86.     //**FONTOS!**//(maradjon alul)
  87.     register_clcmd("say", "sayhook");
  88. }
  89. public hudrendszer(id)
  90. {
  91.     if(!hudkibe[id])
  92.         return;
  93.     if(is_user_alive(id))
  94.     {
  95.         set_hudmessage(0, 255, 0, 0.07, 0.14, 0, 6.0, 12.0)
  96.         show_hudmessage(id, "Ă–lĂ©sek: %d^nRangod: %s^nParancsok: /rang, /hud", olesek[id], rangok[szint[id]]);
  97.     }
  98. }
  99. public hudkibekapcs(id)
  100. {
  101.     if(hudkibe[id])
  102.     {
  103.         ColorChat(id, GREEN, "^4[%s] ^1Kikapcsoltad a hudot.", PREFIX);
  104.         hudkibe[id] = false;
  105.     }
  106.     else
  107.     {
  108.         ColorChat(id, GREEN, "^4[%s] ^1Bekapcsoltad a hudot.", PREFIX);
  109.         hudkibe[id] = true;
  110.     }
  111. }
  112. public halal(id)
  113. {
  114.     new killer = read_data(1);
  115.     new victim = read_data(2);
  116.    
  117.    
  118.     if(killer != victim)
  119.         olesek[killer]++
  120.    
  121.     while(olesek[killer] >= szamok[szint[killer]])
  122.     {
  123.         szint[killer]++
  124.     }
  125. }
  126. public showrang(id)
  127. {
  128.     if(szint[id] != ASD+1)
  129.     {
  130.         ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d ^1| ^3Kell mĂ©g: ^4%d", PREFIX, rangok[szint[id]], olesek[id], szamok[szint[id]]-olesek[id]);
  131.     }
  132.     else
  133.     {
  134.         ColorChat(id, GREEN, "^4[%s] ^3Rang: ^4%s ^1| ^3Ă–lĂ©sek: ^4%d", PREFIX, rangok[szint[id]], olesek[id]);
  135.         ColorChat(id, GREEN, "^4[%s] ^1ElĂ©rted a legmagasabb ^3Rangot.", PREFIX);
  136.     }
  137.     return PLUGIN_HANDLED;
  138. }
  139.  
  140. public plugin_cfg()
  141. {
  142.     g_SqlTuple = SQL_MakeDbTuple(SQLINFO[0], SQLINFO[1], SQLINFO[2], SQLINFO[3])
  143.     static Query[10048]
  144.     new Len
  145.     Len += formatex(Query[Len], charsmax(Query), "CREATE TABLE IF NOT EXISTS `rangrendszer`")
  146.     Len += formatex(Query[Len], charsmax(Query)-Len, "(`Steamid` varchar(32) NOT NULL, ")
  147.     Len += formatex(Query[Len], charsmax(Query)-Len, "`olesek` int(11) NOT NULL,")
  148.     Len += formatex(Query[Len], charsmax(Query)-Len, "`szint` int(11) NOT NULL,")
  149.    
  150.     Len += formatex(Query[Len], charsmax(Query)-Len, "`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY)")
  151.     SQL_ThreadQuery(g_SqlTuple, "createTableThread", Query)
  152. }
  153. public Load(id) {
  154.     static Query[10048]
  155.     new Data[1], Steam[32]
  156.     get_user_authid(id, Steam, 31)
  157.     Data[0] = id
  158.     formatex(Query, charsmax(Query), "SELECT * FROM `rangrendszer` WHERE Steamid = ^"%s^";", Steam)
  159.     SQL_ThreadQuery(g_SqlTuple, "QuerySelectData", Query, Data, 1)
  160. }
  161. public QuerySelectData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  162.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  163.         log_amx("%s", Error)
  164.         return
  165.     }
  166.     else {
  167.         new id = Data[0];
  168.         if(SQL_NumRows(Query) > 0)
  169.         {
  170.             olesek[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "olesek"))
  171.             szint[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "szint"))
  172.            
  173.         }
  174.         else
  175.         {
  176.             Save(id)
  177.         }
  178.     }
  179. }
  180. public Save(id)
  181. {
  182.     static Query[256]
  183.     new Steam[32]; get_user_authid(id, Steam, 31)
  184.     formatex(Query, charsmax(Query), "INSERT INTO `rangrendszer` (`Steamid`) VALUES (^"%s^");", Steam)
  185.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  186. }
  187. public Update(id)
  188. {
  189.     static Query[10048]
  190.     new Len
  191.     new Steam[32]; get_user_authid(id, Steam, 31)
  192.     Len += formatex(Query[Len], charsmax(Query), "UPDATE `rangrendszer` SET olesek = ^"%i^", ", olesek[id])
  193.    
  194.     Len += formatex(Query[Len], charsmax(Query)-Len, "szint = ^"%i^" WHERE Steamid = ^"%s^";", szint[id], Steam)
  195.     SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query)
  196. }
  197. public createTableThread(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  198.     if(FailState == TQUERY_CONNECT_FAILED)
  199.         set_fail_state("[HIBA*] NEM TUDTAM CSATLAKOZNI AZ ADATBAZISHOZ!")
  200.     else if(FailState == TQUERY_QUERY_FAILED)
  201.         set_fail_state("Query Error")
  202.     if(Errcode)
  203.         log_amx("[HIBA*] HIBAT DOBTAM: %s",Error)
  204. }
  205. public QuerySetData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) {
  206.     if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) {
  207.         log_amx("%s", Error);
  208.         return;
  209.     }
  210. }
  211. public client_putinserver(id)
  212. {
  213.    
  214.     if(!is_user_bot(id))
  215.     {
  216.         Load(id);
  217.     }
  218.     hudkibe[id] = true;
  219.     set_task(1.0, "hudrendszer", id, _, _, "b");
  220.     return PLUGIN_CONTINUE
  221. }
  222. public client_disconnect(id)
  223. {
  224.     if(!is_user_bot(id))
  225.     {
  226.         Update(id)
  227.     }
  228.     olesek[id] = 0
  229.     szint[id] = 0
  230.     hudkibe[id] = true;
  231.    
  232. }
  233.  
  234. public sayhook(id)
  235. {
  236.     new message[192], nev[32], none[2][32], chat[192];
  237.     read_args(message, 191);
  238.     remove_quotes(message);
  239.    
  240.     formatex(none[0], 31, ""), formatex(none[1], 31, " ");
  241.    
  242.     if (message[0] == '@' || message[0] == '/' || message[0] == '#' || message[0] == '!' || equal (message, ""))
  243.         return PLUGIN_HANDLED;
  244.    
  245.     if(!equali(message, none[0]) && !equali(message, none[1]))
  246.     {
  247.         get_user_name(id, nev, 31);
  248.         if(is_user_alive(id))
  249.         {
  250.             if(get_user_flags(id) & TULAJ)
  251.                 formatex(chat, 191, "^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  252.             else if(get_user_flags(id) & FOADMIN)
  253.                 formatex(chat, 191, "^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  254.             else if(get_user_flags(id) & ADMIN)
  255.                 formatex(chat, 191, "^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  256.             else if(get_user_flags(id) & KISADMIN)
  257.                 formatex(chat, 191, "^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  258.             else
  259.                 formatex(chat, 191, "^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  260.         }
  261.         else {
  262.            
  263.             if(get_user_flags(id) & TULAJ)
  264.                 formatex(chat, 191, "^x01*Halott*^x04[Tulajdonos][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  265.             else if(get_user_flags(id) & FOADMIN)
  266.                 formatex(chat, 191, "^x01*Halott*^x04[Főadmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  267.             else if(get_user_flags(id) & ADMIN)
  268.                 formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  269.             else if(get_user_flags(id) & ADMIN)
  270.                 formatex(chat, 191, "^x01*Halott*^x04[Admin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  271.             else if(get_user_flags(id) & KISADMIN)
  272.                 formatex(chat, 191, "^x01*Halott*^x04[KisAdmin][%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  273.             else
  274.                 formatex(chat, 191, "^x01*Halott*^x04[%s]^3%s^x04: %s", rangok[szint[id]], nev, message);
  275.         }
  276.        
  277.        
  278.         switch(cs_get_user_team(id)) //Prefix
  279.         {
  280.             case 1: ColorChat(0, RED, chat);
  281.                 case 2: ColorChat(0, BLUE, chat);
  282.             }
  283.         if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  284.             ColorChat(0, GREY, chat);
  285.         return PLUGIN_HANDLED;
  286.     }
  287.     return PLUGIN_CONTINUE;
  288. }
  289. public sendmessage(color[])
  290. {
  291.     new teamName[10];
  292.     for(new player = 1; player < get_maxplayers(); player++)
  293.     {
  294.         get_user_team (player, teamName, 9);
  295.         teamf (player, color);
  296.         elkuldes(player, Temp);
  297.         teamf(player, teamName);
  298.     }
  299. }
  300. public teamf(player, team[])
  301. {
  302.     message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player);
  303.     write_byte(player);
  304.     write_string(team);
  305.     message_end();
  306. }
  307. public elkuldes(player, Temp[])
  308. {
  309.     message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, player);
  310.     write_byte( player );
  311.     write_string( Temp );
  312.     message_end();
  313. }
  314. public plugin_end()
  315. {
  316.     SQL_FreeHandle(g_SqlTuple);
  317. }

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 1300 bytes
Code size: 11124 bytes
Data size: 128952 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 157760 bytes
Done.


Próbáld.
Teszteltem, nekem jó volt.



Tökéletes,működik! :)


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


Ki van itt

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