Guest User

Untitled

a guest
Apr 25th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. #define TAG "Furien"
  6.  
  7. new cvar_money
  8.  
  9. public plugin_init()
  10. {
  11. register_plugin("T/CT Last Bonus", "1.5", "AMG");
  12. register_event("DeathMsg", "ev_DeathMsg", "a");
  13.  
  14. cvar_money = register_cvar("last_money", "3000")
  15. }
  16.  
  17. #if AMXX_VERSION_NUM >= 183
  18. public client_disconnected(id) {
  19. #else
  20. public client_disconnect(id) {
  21. #endif
  22. if(is_user_alive(id))
  23. set_task(0.5, "ev_DeathMsg");
  24. }
  25.  
  26. public ev_DeathMsg() {
  27. new Players[32], inum, x;
  28. get_players(Players, inum, "a");
  29.  
  30. if(inum <= 1 || inum >= 3) return;
  31.  
  32. new id_last_ct, id_last_t;
  33.  
  34. for(new i = 0; i < inum; i++) {
  35. x = Players[i];
  36. if(is_user_connected(x) && is_user_alive(x)) {
  37. if(get_user_team(x) == 1) id_last_t = x;
  38. else if (get_user_team(x) == 2) id_last_ct = x;
  39. if(id_last_ct != 0 && id_last_t != 0) break;
  40. }
  41. }
  42. if(id_last_ct != 0 && id_last_t != 0) {
  43. cs_set_user_money(id_last_ct, cs_get_user_money(id_last_ct) + get_pcvar_num(cvar_money))
  44. culoare(0, "!g[!t%s!g] !g%s !teste ultimul !gCT !tsi a primit un bonus de !g$%d.", TAG, user_name(id_last_ct) ,get_pcvar_num(cvar_money))
  45. cs_set_user_money(id_last_t, cs_get_user_money(id_last_t) + get_pcvar_num(cvar_money))
  46. culoare(0, "!g[!t%s!g] !g%s !teste ultimul !gT !tsi a primit un bonus de !g$%d.", TAG, user_name(id_last_t) ,get_pcvar_num(cvar_money))
  47. }
  48. }
  49.  
  50. stock user_name(const id) {
  51. static Name[33];
  52. get_user_name(id, Name, sizeof(Name)-1);
  53. return Name;
  54. }
  55.  
  56. stock culoare (const id, const input[], any:...)
  57. {
  58. new count = 1, players[ 32 ];
  59. static msg[ 191 ];
  60. vformat( msg, 190, input, 3 );
  61.  
  62. replace_all( msg, 190, "!g", "^4" );
  63. replace_all( msg, 190, "!y", "^1" );
  64. replace_all( msg, 190, "!t2", "^2" );
  65. replace_all( msg, 190, "!t", "^3" );
  66.  
  67.  
  68. if(id) players[ 0 ] = id; else get_players( players, count, "ch" );
  69. {
  70. for(new i = 0; i < count; i++)
  71. {
  72. if( is_user_connected( players[ i ] ) )
  73. {
  74. message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[ i ] );
  75. write_byte( players[ i ] );
  76. write_string( msg );
  77. message_end( );
  78. }
  79. }
  80. }
  81. }
  82.  
Add Comment
Please, Sign In to add comment