hlmod.hu
https://hlmod.hu/

KGB Bots
https://hlmod.hu/viewtopic.php?f=101&t=23311
Oldal: 2 / 3

Szerző:  KillMan [ 2016.01.01. 17:36 ]
Hozzászólás témája:  Re: KGB Bots

41 a legtöbb,

Szerző:  kengurumancs [ 2016.01.01. 17:46 ]
Hozzászólás témája:  Re: KGB Bots

Nem gondolod hogy kicsit sok? :)
30 körül lehet max ha jól tudom.

Szerző:  *GrafitY* [ 2016.07.29. 16:14 ]
Hozzászólás témája:  Re: KGB Bots

Lehet több botot is berakni, vagy csak 2?

Szerző:  voga955 [ 2016.07.29. 16:17 ]
Hozzászólás témája:  Re: KGB Bots

Persze,hogy lehet ,ha segítség kell nyiss egy témát.

Szerző:  kengurumancs [ 2016.07.29. 16:29 ]
Hozzászólás témája:  Re: KGB Bots

voga955 írta:
Persze,hogy lehet ,ha segítség kell nyiss egy témát.

Jelentéktelen hozzászólásokat hanyagold.
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4.  
  5. enum Cvars
  6. {
  7. botname1,
  8. botname2,
  9. botname3,
  10. minplayers,
  11. starttime,
  12. endtime,
  13. onecon,
  14. onebot,
  15. norounds
  16. };
  17.  
  18. new const cvar_names[ Cvars ][] =
  19. {
  20. "amx_botname",
  21. "amx_botname2",
  22. "amx_botname3",
  23. "amx_minplayers",
  24. "amx_starttime",
  25. "amx_endtime",
  26. "amx_onecon",
  27. "amx_onebot",
  28. "amx_norounds"
  29. };
  30.  
  31. new const cvar_defaults[ Cvars ][] =
  32. {
  33. "Bot",
  34. "Bot 2",
  35. "Bot 3",
  36. "10",
  37. "00",
  38. "12",
  39. "0",
  40. "0",
  41. "0"
  42. };
  43.  
  44. new cvar_pointer[ Cvars ];
  45. new bool:g_isTime = false;
  46. new bool:g_ePlayers = false;
  47. new bool:g_isFirstRound = true;
  48. new g_BotNum = 0, g_maxplayers, g_bID1, g_bID2, g_bID3;
  49.  
  50. new const g_ConfigFile[] = "addons/amxmodx/configs/kgbbots.cfg"
  51.  
  52. public plugin_init()
  53. {
  54. register_logevent("Event_RoundEnd", 2, "1=Round_End");
  55. register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
  56.  
  57. for ( new Cvars:i = botname1 ; i < Cvars ; i++ )
  58. cvar_pointer[ i ] = register_cvar( cvar_names[ i ] , cvar_defaults[ i ] );
  59.  
  60. g_maxplayers = get_maxplayers();
  61. server_cmd("exec %s", g_ConfigFile)
  62. set_task(3.0, "isit")
  63. }
  64.  
  65. public isit() {
  66. if(get_pcvar_num(cvar_pointer[norounds]))
  67. set_task(30.0, "CheckConditions",0,"",0,"b")
  68. }
  69.  
  70. public plugin_precache()
  71. {
  72. if(!file_exists(g_ConfigFile))
  73. {
  74.     write_file(g_ConfigFile, "KGB Bots - Beállítások^n")
  75.     write_file(g_ConfigFile, "amx_botname ^"KGB Bot1^"   //Első bot neve")
  76.     write_file(g_ConfigFile, "amx_botname2 ^"KGB Bot2^"   //Második bot neve")
  77.     write_file(g_ConfigFile, "amx_botname3 ^"KGB Bot3^"   //Második bot neve")
  78.     write_file(g_ConfigFile, "amx_minplayers ^"10^"   //Ennyi játékostól dobja ki a szerver a botokat. Ha,kevesebb lesz a létszám akkor vissza jönnek!")
  79.     write_file(g_ConfigFile, "amx_starttime ^"0^"   //Hány órától legyenek fent a botok a szerón")
  80.     write_file(g_ConfigFile, "amx_endtime ^"12^"   //Hány órán át legyenek botok?")
  81.     write_file(g_ConfigFile, "amx_onecon ^"0^"   //A kezdési idő és minplayers létszám feltételeknek muszáj együttesen teljesülniük a botok berakásához[0 -nem, 1 -igen]")
  82.     write_file(g_ConfigFile, "amx_onebot ^"0^"   //Egy bot menjen csak fel a szerverre?[0 -nem, 1 -igen]")
  83.     write_file(g_ConfigFile, "amx_norounds ^"0^"   //Végtelen köridő (0-1) (ellenőrzés 30mp-enként)[0 -nem, 1 -igen]")
  84. }
  85. }
  86.  
  87. public Event_RoundEnd()
  88. {
  89. if (!g_isFirstRound)
  90.     return;
  91.    
  92.     g_isFirstRound = false;
  93. }
  94.  
  95. public Event_NewRound()
  96. {
  97.     if(g_isFirstRound)
  98.         return;
  99.    
  100.     CheckConditions();
  101. }
  102.  
  103. public CheckConditions()
  104. {
  105.     static iHours, m, s
  106.     time(iHours, m, s)
  107.    
  108.     new iMin = get_pcvar_num(cvar_pointer[ starttime ]);
  109.     new iMax = get_pcvar_num(cvar_pointer[ endtime ]);
  110.    
  111.     if(iMin == iMax)
  112.         g_isTime = true;
  113.     else if(iMin > iMax)
  114.     {
  115.         switch(iHours)
  116.         {
  117.             case 0..11:
  118.             {
  119.                 if(iMin >= iHours && iMax > iHours)
  120.                     g_isTime = true;
  121.             }
  122.             case 12..23:
  123.             {
  124.                 if(iMin <= iHours && iMax < iHours)
  125.                     g_isTime = true;
  126.             }
  127.         }
  128.     }
  129.     else if(iMin <= iHours && iMax > iHours)
  130.         g_isTime = true;
  131.     else
  132.         g_isTime = false;
  133.    
  134.     new iNum, iPlayers[32];
  135.     get_players(iPlayers, iNum, "c");
  136.    
  137.     if(iNum <= get_pcvar_num(cvar_pointer[minplayers]))
  138.         g_ePlayers = true;
  139.     else
  140.         g_ePlayers = false;
  141.    
  142.     if(g_maxplayers - iNum < 2)
  143.         g_ePlayers = false;
  144.    
  145.     if(get_pcvar_num(cvar_pointer[minplayers]) == 0)
  146.         g_ePlayers = true
  147.    
  148.     new iCondition = get_pcvar_num(cvar_pointer[ onecon ]);
  149.     if( (!g_ePlayers && g_isTime || !g_isTime && g_ePlayers) && iCondition)
  150.     {
  151.         g_isTime = true;
  152.         g_ePlayers = true;
  153.     }
  154.    
  155.    
  156.    
  157.     if((g_isTime && g_ePlayers) && !g_BotNum)
  158.     {
  159.         if(!get_pcvar_num(cvar_pointer[onebot]))
  160.             set_task(1.5, "Task_AddBot")
  161.         set_task(2.8, "Task_AddBot")
  162.         set_task(4.2, "Task_AddBot")
  163.     }
  164.     else if((!g_isTime || !g_ePlayers) && 0 < g_BotNum <= 3 )
  165.     {
  166.         g_BotNum = 0;
  167.         server_cmd("kick #%d", g_bID1)
  168.         server_cmd("kick #%d", g_bID2)
  169.         server_cmd("kick #%d", g_bID3)
  170.     }
  171. }
  172.  
  173. public Task_AddBot()
  174. {
  175.     static iBot;
  176.     new iBotName[35];
  177.    
  178.     switch(g_BotNum)
  179.     {
  180.         case 0: get_pcvar_string(cvar_pointer[ botname1 ], iBotName, charsmax( iBotName ));
  181.             case 1: get_pcvar_string(cvar_pointer[ botname2 ], iBotName, charsmax( iBotName ));
  182.             case 2: get_pcvar_string(cvar_pointer[ botname3 ], iBotName, charsmax( iBotName ));
  183.             case 3: return;
  184.         }
  185.    
  186.     iBot = engfunc( EngFunc_CreateFakeClient, iBotName );
  187.    
  188.     if(!iBot)
  189.         return;
  190.    
  191.     dllfunc( MetaFunc_CallGameEntity, "player", iBot );
  192.     set_pev( iBot, pev_flags, FL_FAKECLIENT );
  193.    
  194.     set_pev( iBot, pev_model, "" );
  195.     set_pev( iBot, pev_viewmodel2, "" );
  196.     set_pev( iBot, pev_modelindex, 0 );
  197.    
  198.     set_pev( iBot, pev_renderfx, kRenderFxNone );
  199.     set_pev( iBot, pev_rendermode, kRenderTransAlpha );
  200.     set_pev( iBot, pev_renderamt, 0.0 );
  201.    
  202.     set_pdata_int( iBot, 114, 3 );
  203.     cs_set_user_team( iBot, CS_TEAM_UNASSIGNED );
  204.    
  205.     switch(g_BotNum)
  206.     {
  207.         case 0: g_bID1 = get_user_userid(iBot);
  208.             case 1: g_bID2 = get_user_userid(iBot);
  209.                 case 2: g_bID3 = get_user_userid(iBot);
  210.         }
  211.     g_BotNum++;
  212. }


Kód:
amx_botname "ts3.asdada.eu"
amx_botname2 "fb.com/groups/asdasdsadasd"
amx_botname3 "www.asdadasdasdsa.eu"
amx_minplayers "17"
amx_starttime "24"
amx_endtime "24"
amx_onecon "0"
amx_onebot "0"
amx_norounds "1"

Szerző:  *GrafitY* [ 2016.07.29. 19:41 ]
Hozzászólás témája:  Re: KGB Bots

kengurumancs írta:
voga955 írta:
Persze,hogy lehet ,ha segítség kell nyiss egy témát.

Jelentéktelen hozzászólásokat hanyagold.
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4.  
  5. enum Cvars
  6. {
  7. botname1,
  8. botname2,
  9. botname3,
  10. minplayers,
  11. starttime,
  12. endtime,
  13. onecon,
  14. onebot,
  15. norounds
  16. };
  17.  
  18. new const cvar_names[ Cvars ][] =
  19. {
  20. "amx_botname",
  21. "amx_botname2",
  22. "amx_botname3",
  23. "amx_minplayers",
  24. "amx_starttime",
  25. "amx_endtime",
  26. "amx_onecon",
  27. "amx_onebot",
  28. "amx_norounds"
  29. };
  30.  
  31. new const cvar_defaults[ Cvars ][] =
  32. {
  33. "Bot",
  34. "Bot 2",
  35. "Bot 3",
  36. "10",
  37. "00",
  38. "12",
  39. "0",
  40. "0",
  41. "0"
  42. };
  43.  
  44. new cvar_pointer[ Cvars ];
  45. new bool:g_isTime = false;
  46. new bool:g_ePlayers = false;
  47. new bool:g_isFirstRound = true;
  48. new g_BotNum = 0, g_maxplayers, g_bID1, g_bID2, g_bID3;
  49.  
  50. new const g_ConfigFile[] = "addons/amxmodx/configs/kgbbots.cfg"
  51.  
  52. public plugin_init()
  53. {
  54. register_logevent("Event_RoundEnd", 2, "1=Round_End");
  55. register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
  56.  
  57. for ( new Cvars:i = botname1 ; i < Cvars ; i++ )
  58. cvar_pointer[ i ] = register_cvar( cvar_names[ i ] , cvar_defaults[ i ] );
  59.  
  60. g_maxplayers = get_maxplayers();
  61. server_cmd("exec %s", g_ConfigFile)
  62. set_task(3.0, "isit")
  63. }
  64.  
  65. public isit() {
  66. if(get_pcvar_num(cvar_pointer[norounds]))
  67. set_task(30.0, "CheckConditions",0,"",0,"b")
  68. }
  69.  
  70. public plugin_precache()
  71. {
  72. if(!file_exists(g_ConfigFile))
  73. {
  74.     write_file(g_ConfigFile, "KGB Bots - Beállítások^n")
  75.     write_file(g_ConfigFile, "amx_botname ^"KGB Bot1^"   //Első bot neve")
  76.     write_file(g_ConfigFile, "amx_botname2 ^"KGB Bot2^"   //Második bot neve")
  77.     write_file(g_ConfigFile, "amx_botname3 ^"KGB Bot3^"   //Második bot neve")
  78.     write_file(g_ConfigFile, "amx_minplayers ^"10^"   //Ennyi játékostól dobja ki a szerver a botokat. Ha,kevesebb lesz a létszám akkor vissza jönnek!")
  79.     write_file(g_ConfigFile, "amx_starttime ^"0^"   //Hány órától legyenek fent a botok a szerón")
  80.     write_file(g_ConfigFile, "amx_endtime ^"12^"   //Hány órán át legyenek botok?")
  81.     write_file(g_ConfigFile, "amx_onecon ^"0^"   //A kezdési idő és minplayers létszám feltételeknek muszáj együttesen teljesülniük a botok berakásához[0 -nem, 1 -igen]")
  82.     write_file(g_ConfigFile, "amx_onebot ^"0^"   //Egy bot menjen csak fel a szerverre?[0 -nem, 1 -igen]")
  83.     write_file(g_ConfigFile, "amx_norounds ^"0^"   //Végtelen köridő (0-1) (ellenőrzés 30mp-enként)[0 -nem, 1 -igen]")
  84. }
  85. }
  86.  
  87. public Event_RoundEnd()
  88. {
  89. if (!g_isFirstRound)
  90.     return;
  91.    
  92.     g_isFirstRound = false;
  93. }
  94.  
  95. public Event_NewRound()
  96. {
  97.     if(g_isFirstRound)
  98.         return;
  99.    
  100.     CheckConditions();
  101. }
  102.  
  103. public CheckConditions()
  104. {
  105.     static iHours, m, s
  106.     time(iHours, m, s)
  107.    
  108.     new iMin = get_pcvar_num(cvar_pointer[ starttime ]);
  109.     new iMax = get_pcvar_num(cvar_pointer[ endtime ]);
  110.    
  111.     if(iMin == iMax)
  112.         g_isTime = true;
  113.     else if(iMin > iMax)
  114.     {
  115.         switch(iHours)
  116.         {
  117.             case 0..11:
  118.             {
  119.                 if(iMin >= iHours && iMax > iHours)
  120.                     g_isTime = true;
  121.             }
  122.             case 12..23:
  123.             {
  124.                 if(iMin <= iHours && iMax < iHours)
  125.                     g_isTime = true;
  126.             }
  127.         }
  128.     }
  129.     else if(iMin <= iHours && iMax > iHours)
  130.         g_isTime = true;
  131.     else
  132.         g_isTime = false;
  133.    
  134.     new iNum, iPlayers[32];
  135.     get_players(iPlayers, iNum, "c");
  136.    
  137.     if(iNum <= get_pcvar_num(cvar_pointer[minplayers]))
  138.         g_ePlayers = true;
  139.     else
  140.         g_ePlayers = false;
  141.    
  142.     if(g_maxplayers - iNum < 2)
  143.         g_ePlayers = false;
  144.    
  145.     if(get_pcvar_num(cvar_pointer[minplayers]) == 0)
  146.         g_ePlayers = true
  147.    
  148.     new iCondition = get_pcvar_num(cvar_pointer[ onecon ]);
  149.     if( (!g_ePlayers && g_isTime || !g_isTime && g_ePlayers) && iCondition)
  150.     {
  151.         g_isTime = true;
  152.         g_ePlayers = true;
  153.     }
  154.    
  155.    
  156.    
  157.     if((g_isTime && g_ePlayers) && !g_BotNum)
  158.     {
  159.         if(!get_pcvar_num(cvar_pointer[onebot]))
  160.             set_task(1.5, "Task_AddBot")
  161.         set_task(2.8, "Task_AddBot")
  162.         set_task(4.2, "Task_AddBot")
  163.     }
  164.     else if((!g_isTime || !g_ePlayers) && 0 < g_BotNum <= 3 )
  165.     {
  166.         g_BotNum = 0;
  167.         server_cmd("kick #%d", g_bID1)
  168.         server_cmd("kick #%d", g_bID2)
  169.         server_cmd("kick #%d", g_bID3)
  170.     }
  171. }
  172.  
  173. public Task_AddBot()
  174. {
  175.     static iBot;
  176.     new iBotName[35];
  177.    
  178.     switch(g_BotNum)
  179.     {
  180.         case 0: get_pcvar_string(cvar_pointer[ botname1 ], iBotName, charsmax( iBotName ));
  181.             case 1: get_pcvar_string(cvar_pointer[ botname2 ], iBotName, charsmax( iBotName ));
  182.             case 2: get_pcvar_string(cvar_pointer[ botname3 ], iBotName, charsmax( iBotName ));
  183.             case 3: return;
  184.         }
  185.    
  186.     iBot = engfunc( EngFunc_CreateFakeClient, iBotName );
  187.    
  188.     if(!iBot)
  189.         return;
  190.    
  191.     dllfunc( MetaFunc_CallGameEntity, "player", iBot );
  192.     set_pev( iBot, pev_flags, FL_FAKECLIENT );
  193.    
  194.     set_pev( iBot, pev_model, "" );
  195.     set_pev( iBot, pev_viewmodel2, "" );
  196.     set_pev( iBot, pev_modelindex, 0 );
  197.    
  198.     set_pev( iBot, pev_renderfx, kRenderFxNone );
  199.     set_pev( iBot, pev_rendermode, kRenderTransAlpha );
  200.     set_pev( iBot, pev_renderamt, 0.0 );
  201.    
  202.     set_pdata_int( iBot, 114, 3 );
  203.     cs_set_user_team( iBot, CS_TEAM_UNASSIGNED );
  204.    
  205.     switch(g_BotNum)
  206.     {
  207.         case 0: g_bID1 = get_user_userid(iBot);
  208.             case 1: g_bID2 = get_user_userid(iBot);
  209.                 case 2: g_bID3 = get_user_userid(iBot);
  210.         }
  211.     g_BotNum++;
  212. }


Kód:
amx_botname "ts3.asdada.eu"
amx_botname2 "fb.com/groups/asdasdsadasd"
amx_botname3 "www.asdadasdasdsa.eu"
amx_minplayers "17"
amx_starttime "24"
amx_endtime "24"
amx_onecon "0"
amx_onebot "0"
amx_norounds "1"


Így most igaz 3 specbot adható hozzá?

Szerző:  kengurumancs [ 2016.07.29. 21:08 ]
Hozzászólás témája:  Re: KGB Bots

Igen, most 3db bot lesz.

Szerző:  HipHop BoyS®™ [ 2016.09.25. 21:29 ]
Hozzászólás témája:  Re: KGB Bots

Köszönöm a feltöltéstt.

Szerző:  FonoK [ 2017.01.20. 22:36 ]
Hozzászólás témája:  Re: KGB Bots

Kitűnően működik, nagy hasznát vettem, nagyon szépen köszönöm! :)

Szerző:  menyus [ 2018.05.05. 21:47 ]
Hozzászólás témája:  Re: KGB Bots

beraktam szeróra mindent úgy csináltam és nem jönnek fel a botok mit kel beírni h botok jöjjenek fel ?

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