Advertisement
Garey

boost_recommender

Mar 11th, 2019
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.49 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <dhudmessage>
  3.  
  4. #define PLUGIN "Boost Recommender"
  5. #define VERSION "1.0"
  6. #define AUTHOR "trans"
  7.  
  8. new g_currentMap[33];
  9. new g_szLine[64][33];
  10. new g_szLinesCount;
  11. new szPlayers[33];
  12.  
  13. public plugin_init() {
  14.     register_plugin(PLUGIN, AUTHOR, VERSION);
  15.  
  16.     register_event("HLTV", "RoundStart", "a", "1=0", "2=0");
  17.  
  18.     read_sample();
  19. }
  20.  
  21. public read_sample() {
  22.     new path[33];
  23.     new map[33];
  24.  
  25.     get_mapname(map, 32);
  26.     get_configsdir(path, charsmax(path));
  27.  
  28.     format(path, charsmax(path), "%s/trans/%s.txt", path, map);
  29.  
  30.     if(file_exists(path)) {
  31.         new szData[33], szSample[33], iTextLength, iLine;
  32.  
  33.         while(read_file(path, iLine, szData, charsmax(szData), iTextLength) != 0) {
  34.             if(iLine > charsmax(g_szLine[]))
  35.                 break;
  36.            
  37.             parse(szData, szSample, charsmax(szSample));
  38.  
  39.             if(szSample[0] == ';' || !szSample[0]) {
  40.                 iLine++;
  41.                 continue;
  42.             }
  43.  
  44.             g_szLine[iLine] = szSample;
  45.  
  46.             iLine++;
  47.             szLinesCount += iLine;
  48.         }
  49.     } else {
  50.         return PLUGIN_HANDLED;
  51.     }
  52. }
  53.  
  54. public RoundStart() {
  55.     new count;
  56.     get_players(szPlayers, count, "e", "TERRORIST");
  57.  
  58.     new rand = random_num(1, szLinesCount);
  59.  
  60.     for(new i = 0; i < count; i++) {
  61.         set_dhudmessage(0, 0, 190, -1.0, 0.65, 2, 6.0, 5.0, 0.1, 1.5, false);
  62.         show_dhudmessage(szPlayers[i], "DO %s", g_szLine[rand]);
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement