Advertisement
krot

amxmodx test

Nov 3rd, 2019
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.21 KB | None | 0 0
  1. #include <amxmodx>
  2. new num1
  3.  
  4. public plugin_init()
  5. {
  6.     register_clcmd( "say /test", "ClientCommand_Test" );
  7.      register_clcmd("say /q", "ClCmdTest");
  8. }
  9.  
  10. public ClCmdTest(pId)
  11. {
  12.              
  13.   set_hudmessage(255, 255, 255, 0.01, 0.4, 0, 0.0, 0.0, 0.6, 1.0, false);
  14.   num1 = random_num(1, 100);
  15.   show_hudmessage(pId, "qfgyjhyuhf = 1341+444444+ %d ?",num1);
  16. }
  17. /*blue - Количество синего цвета;
  18. x - Координата X, идёт слева направо, 0.0 слева, 1.0 справа, -1.0 по центру;
  19. y - Координата Y, идёт сверху вниз, 0.0 сверху, 1.0 снизу, -1.0 по центру;
  20. effects - Эффект сообщения:
  21. 0 - Появление -> Простой -> Пропадание (Затухание),
  22. 1 - (Появление -> Простой -> Пропадание (Затухание)) + Мигание,
  23. 2 - Печатание букв -> Простой -> Пропадание (Затухание);
  24. fxtime - Время отставания блеска от печатания букв во 2-ом эффекте ("Скользящий блеск");
  25. holdtime - Время простоя сообщения;
  26. fadeintime - Время появления сообщения, во 2-ом эффекте скорость печатания (1 буква в % секунд);
  27. fadeouttime - Время пропадания сообщения (Затухание);
  28. channel - канал сообщения, при -1 ищет следующий канал (Существует ограничение в 4 канала, т.е. не может быть больше 4 сообщений одновременно.*/
  29.  
  30. public ClientCommand_Test( client )
  31. {
  32.     sendHudMessage
  33.     (
  34.         .index       = client,
  35.         .message     = "Welcome to our server,^n111111111111111111",//no matter
  36.         .red         = 255,
  37.         .green       = 120,
  38.         .blue        = 0,
  39.         .x           = 0.05,
  40.         .y           = 0.2,
  41.         .effect      = 2,
  42.         .fxTime      = 17.0,
  43.         .holdTime    = 15.0,
  44.         .fadeInTime  = 0.1,
  45.         .fadeOutTime = 3.0
  46.     );
  47. }
  48.  
  49. sendHudMessage( const index, const message[], const red=255, const green=120, const blue=0,
  50.         const Float:x, const Float:y, const effect, const Float:fxTime,
  51.         const Float:holdTime, const Float:fadeInTime, const Float:fadeOutTime)//also and here i changed
  52. {
  53.     #define pack_color(%0,%1,%2) ( %0 + ( %1 << 8 ) + ( %2 << 16 ) )
  54.     #define write_float(%0)      ( write_byte( ( _:%0 & 0xFF ) ),       \
  55.     write_byte( ( _:%0 >>  8 ) & 0xFF ), \
  56.     write_byte( ( _:%0 >> 16 ) & 0xFF ), \
  57.     write_byte( ( _:%0 >> 24 ) & 0xFF ) )
  58.    
  59.     message_begin( MSG_ONE, SVC_DIRECTOR, .player = index );
  60.     {
  61.         write_byte( strlen( message ) + 31 ); // size of write_*
  62.         write_byte( DRC_CMD_MESSAGE );
  63.         write_byte( effect );
  64.         write_long( pack_color( red, green, blue ) );
  65.         write_float( x );
  66.         write_float( y );
  67.         write_float( fadeInTime  );
  68.         write_float( fadeOutTime  );
  69.         write_float( holdTime );
  70.         write_float( fxTime );
  71.         write_string( message );
  72.     }
  73.     message_end();
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement