Advertisement
mforce

Autodemo recorder

Sep 19th, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.37 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "AutoDemo Recorder"
  4. #define VERSION "1.0.1"
  5. #define AUTHOR "mforce"
  6.  
  7. new const PREFIX[] = "ProKillers"
  8. new const DEMONEVE[] = "pkserver"
  9.  
  10. public plugin_init() {
  11.     register_plugin(PLUGIN, VERSION, AUTHOR);
  12. }
  13.  
  14. public client_putinserver(id) {
  15.     set_task(5.0, "record", id);
  16. }
  17.  
  18. public record(id) {
  19.     if(!is_user_connected(id)) return;
  20.     client_cmd(id, "stop; record ^"%s.dem^"", DEMONEVE);
  21.     ChatColor(id, "^4[%s]^1 Demo felvétel elindult a^3 %s.dem^1 fájlba.", PREFIX, DEMONEVE);
  22.     new ido[64]; get_time("%Y.%m.%d %H:%M:%S", ido, charsmax(ido));
  23.     ChatColor(id, "^4[%s]^1 Idő: ^3%s", PREFIX, ido);
  24. }
  25.  
  26. public client_disconnect(id) {
  27.     if(task_exists(id)) remove_task(id);
  28. }
  29.  
  30. stock ChatColor(const id, const szMessage[], any:...) {
  31.         static pnum, players[32], szMsg[190], IdMsg;
  32.         vformat(szMsg, charsmax(szMsg), szMessage, 3);
  33.        
  34.         if(!IdMsg) IdMsg = get_user_msgid("SayText");
  35.        
  36.         if(id) {
  37.                 if(!is_user_connected(id)) return;
  38.                 players[0] = id;
  39.                 pnum = 1;
  40.         }
  41.         else get_players(players, pnum, "ch");
  42.        
  43.         for(new i; i < pnum; i++) {
  44.                 message_begin(MSG_ONE, IdMsg, .player = players[i]);
  45.                 write_byte(players[i]);
  46.                 write_string(szMsg);
  47.                 message_end();
  48.         }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement