hlmod.hu
https://hlmod.hu/

BRR
https://hlmod.hu/viewtopic.php?f=29&t=24143
Oldal: 1 / 1

Szerző:  *GrafitY* [2016.02.29. 18:59 ]
Hozzászólás témája:  BRR

Sziasztok!
Találtam egy Block spawn for reconnect nevű plugint, de nem tudom hogy jó e vagy sem :?
Valaki segítene?
Köszönöm!

  1. #include < amxmodx >
  2. #include < fakemeta >
  3.  
  4. new const PLUGIN_NAME[ ]        =       "Block Spawn For Reconnect";
  5. new const PLUGIN_VERSION[ ]     =       "0.1";
  6. new const PLUGIN_AUTHOR[ ]      =       "Bos93";
  7.  
  8. const m_iSpawnCount = 365;
  9.  
  10. new Trie:g_pSteam;
  11.  
  12. public plugin_init( )
  13. {
  14.         register_plugin( PLUGIN_NAME,   PLUGIN_VERSION, PLUGIN_AUTHOR );
  15.         register_event("HLTV", "EventRoundStart", "a", "1=0", "2=0");
  16.  
  17.         g_pSteam = TrieCreate( );
  18.  
  19. }
  20.  
  21. public client_disconnect( pPlayer )
  22. {
  23.         new szSteam[ 32 ];
  24.  
  25.         get_user_authid( pPlayer, szSteam, charsmax( szSteam ) );
  26.  
  27.         TrieSetCell( g_pSteam, szSteam, 1 );
  28. }
  29.  
  30.  
  31. public client_putinserver( pPlayer )
  32. {
  33.         new szSteam[ 32 ];
  34.         get_user_authid( pPlayer, szSteam, charsmax( szSteam ) );
  35.  
  36.         if ( TrieKeyExists( g_pSteam, szSteam ) )
  37.         {
  38.                 set_pdata_int( pPlayer, m_iSpawnCount, 1);
  39.         }
  40. }
  41.  
  42.  
  43. public EventRoundStart( )
  44. {
  45.         TrieClear( g_pSteam );
  46. }


Az mforce által feltöltött nállam "nem működik!"

Szerző:  mforce [2016.02.29. 19:08 ]
Hozzászólás témája:  Re: BRR

Majdnem.
Én így használom, ez biztosabb, abból hiányzik id_lan check,stb. :D

  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <regex>
  4.  
  5. #pragma semicolon 1
  6.  
  7. #if !defined MAX_PLAYERS // check for amxmodx 1.8.3 (thx 9iky6)
  8.     #define MAX_PLAYERS 32
  9. #endif
  10.  
  11. #define is_valid_authid(%0) regex_match_c(%0, g_rAuthId, g_iRegexReturn)
  12. #define m_iNumRespawns 365
  13. #define LINUX_DIFF_PLAYER 5
  14.  
  15. new Trie:g_tAuthId;
  16.  
  17. new Regex:g_rAuthId;
  18.  
  19. new bool:g_bAuthId = true;
  20.  
  21. new g_iRegexReturn, g_szAuthId[MAX_PLAYERS + 1][24];
  22.  
  23. public plugin_init() {
  24.     register_plugin("Block Spawn For Reconnect", "0.3", "Bos93, Subb98");
  25.     register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
  26.     g_tAuthId = TrieCreate();
  27.     new szError[2];
  28.     g_rAuthId = regex_compile("^^(?:STEAM|VALVE)_\d:\d:\d+$", g_iRegexReturn, szError, charsmax(szError));
  29.     if(g_rAuthId < REGEX_OK) {
  30.         g_bAuthId = false;
  31.     }
  32. }
  33.  
  34. public client_putinserver(id) {
  35.     if(!is_user_bot(id) && !is_user_hltv(id)) {
  36.         get_user_authid(id, g_szAuthId[id], charsmax(g_szAuthId[]));
  37.         if(g_bAuthId) {
  38.             if(is_valid_authid(g_szAuthId[id])) {
  39.                 CheckAuthId(id);
  40.             } else {
  41.                 get_user_ip(id, g_szAuthId[id], charsmax(g_szAuthId[]), 1);
  42.                 CheckAuthId(id);
  43.             }
  44.         } else {
  45.             if(contain(g_szAuthId[id], "ID") == -1) {
  46.                 CheckAuthId(id);
  47.             } else {
  48.                 get_user_ip(id, g_szAuthId[id], charsmax(g_szAuthId[]), 1);
  49.                 CheckAuthId(id);
  50.             }
  51.         }
  52.     }
  53. }
  54.  
  55. public client_disconnect(id) {
  56.     if(!is_user_bot(id) && !is_user_hltv(id)) {
  57.         TrieSetCell(g_tAuthId, g_szAuthId[id], 0);
  58.     }
  59. }
  60.  
  61. public plugin_end() {
  62.     TrieDestroy(g_tAuthId);
  63.     regex_free(g_rAuthId);
  64. }
  65.  
  66. public EventHLTV() {
  67.     TrieClear(g_tAuthId);
  68. }
  69.  
  70. CheckAuthId(const id) {
  71.     if(TrieKeyExists(g_tAuthId, g_szAuthId[id])) {
  72.         set_pdata_int(id, m_iNumRespawns, 1, LINUX_DIFF_PLAYER);
  73.     }
  74. }

Szerző:  *GrafitY* [2016.02.29. 19:10 ]
Hozzászólás témája:  Re: BRR

mforce írta:
Majdnem.
Én így használom, ez biztosabb, abból hiányzik id_lan check,stb. :D

  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <regex>
  4.  
  5. #pragma semicolon 1
  6.  
  7. #if !defined MAX_PLAYERS // check for amxmodx 1.8.3 (thx 9iky6)
  8.     #define MAX_PLAYERS 32
  9. #endif
  10.  
  11. #define is_valid_authid(%0) regex_match_c(%0, g_rAuthId, g_iRegexReturn)
  12. #define m_iNumRespawns 365
  13. #define LINUX_DIFF_PLAYER 5
  14.  
  15. new Trie:g_tAuthId;
  16.  
  17. new Regex:g_rAuthId;
  18.  
  19. new bool:g_bAuthId = true;
  20.  
  21. new g_iRegexReturn, g_szAuthId[MAX_PLAYERS + 1][24];
  22.  
  23. public plugin_init() {
  24.     register_plugin("Block Spawn For Reconnect", "0.3", "Bos93, Subb98");
  25.     register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
  26.     g_tAuthId = TrieCreate();
  27.     new szError[2];
  28.     g_rAuthId = regex_compile("^^(?:STEAM|VALVE)_\d:\d:\d+$", g_iRegexReturn, szError, charsmax(szError));
  29.     if(g_rAuthId < REGEX_OK) {
  30.         g_bAuthId = false;
  31.     }
  32. }
  33.  
  34. public client_putinserver(id) {
  35.     if(!is_user_bot(id) && !is_user_hltv(id)) {
  36.         get_user_authid(id, g_szAuthId[id], charsmax(g_szAuthId[]));
  37.         if(g_bAuthId) {
  38.             if(is_valid_authid(g_szAuthId[id])) {
  39.                 CheckAuthId(id);
  40.             } else {
  41.                 get_user_ip(id, g_szAuthId[id], charsmax(g_szAuthId[]), 1);
  42.                 CheckAuthId(id);
  43.             }
  44.         } else {
  45.             if(contain(g_szAuthId[id], "ID") == -1) {
  46.                 CheckAuthId(id);
  47.             } else {
  48.                 get_user_ip(id, g_szAuthId[id], charsmax(g_szAuthId[]), 1);
  49.                 CheckAuthId(id);
  50.             }
  51.         }
  52.     }
  53. }
  54.  
  55. public client_disconnect(id) {
  56.     if(!is_user_bot(id) && !is_user_hltv(id)) {
  57.         TrieSetCell(g_tAuthId, g_szAuthId[id], 0);
  58.     }
  59. }
  60.  
  61. public plugin_end() {
  62.     TrieDestroy(g_tAuthId);
  63.     regex_free(g_rAuthId);
  64. }
  65.  
  66. public EventHLTV() {
  67.     TrieClear(g_tAuthId);
  68. }
  69.  
  70. CheckAuthId(const id) {
  71.     if(TrieKeyExists(g_tAuthId, g_szAuthId[id])) {
  72.         set_pdata_int(id, m_iNumRespawns, 1, LINUX_DIFF_PLAYER);
  73.     }
  74. }


Pls magyarázd el :))
id_lan, check,stb.. nem értem ezeket!

Szerző:  mforce [2016.02.29. 19:13 ]
Hozzászólás témája:  Re: BRR

Az a jobb amit én írtam, amit te írtál az hiányos több oldalból.
Ennyi a történet. De ott a verziószám is.

Szerző:  *GrafitY* [2016.02.29. 19:22 ]
Hozzászólás témája:  Re: BRR

mforce írta:
Az a jobb amit én írtam, amit te írtál az hiányos több oldalból.
Ennyi a történet. De ott a verziószám is.


Köszönöm! :)

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