Guest User

Untitled

a guest
Dec 14th, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. new const CHAT_TAG[] = "[FURIEN]"
  5. new const BANI = 5000
  6.  
  7. public plugin_init() register_event( "DeathMsg", "Event_Death", "a" )
  8.  
  9. public Event_Death()
  10. {
  11. if(CountPlayers(1)==1)
  12. {
  13. new ter=GetRemainingPlayerId(1)
  14. cs_set_user_money(ter,cs_get_user_money(ter)+BANI,1)
  15. print_cc(0,"^4%s^1 -^4 %s^1 - este ultimul^4 FURIEN^1 si primeste (^4%d$^1) BONUS!",CHAT_TAG,get_name(ter),BANI)
  16. }
  17. if(CountPlayers(2)==1)
  18. {
  19. new ct=GetRemainingPlayerId(2)
  20. cs_set_user_money(ct,cs_get_user_money(ct)+BANI,1)
  21. print_cc(0,"^4%s^1 -^4 %s^1 - este ultimul^4 ANTI-FURIEN^1 si primeste (^4%d$^1) BONUS!",CHAT_TAG,get_name(ct),BANI)
  22. }
  23. }
  24.  
  25. stock CountPlayers( const Team )
  26. {
  27. new iPlayers[ 32 ],iPlayersNum,iPlayersCount;
  28. get_players( iPlayers, iPlayersNum, "ach" );
  29. for( new i = 0; i < iPlayersNum; i++ )
  30. {
  31. if( Team == 1 ) if( get_user_team( iPlayers[ i ] ) == 1 ) iPlayersCount++;
  32. else if( Team == 2 ) if( get_user_team( iPlayers[ i ] ) == 2 ) iPlayersCount++;
  33. }
  34. return iPlayersCount;
  35. }
  36. stock GetRemainingPlayerId( const Team )
  37. {
  38. new iPlayers[ 32 ],iPlayersNum,iPlayerId;
  39. get_players( iPlayers, iPlayersNum, "ach" );
  40. for( new i = 0; i < iPlayersNum; i++ )
  41. {
  42. if( Team == 1 ) if( get_user_team( iPlayers[ i ] ) == 1 ) iPlayerId = iPlayers[ i ];
  43. else if( Team == 2 ) if( get_user_team( iPlayers[ i ] ) == 2 ) iPlayerId = iPlayers[ i ];
  44. }
  45. return iPlayerId;
  46. }
  47. stock get_name(const id)
  48. {
  49. new name[32]
  50. get_user_name(id,name,charsmax(name))
  51. return name
  52. }
  53. print_cc(id, fmt[], any:...)
  54. {
  55. static saytext = 0, fake_user;
  56. if (!saytext)
  57. {
  58. saytext = get_user_msgid("SayText");
  59. fake_user = get_maxplayers() + 1;
  60. }
  61. new msg[192];
  62. vformat(msg, charsmax(msg), fmt, 3)
  63. message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, saytext, _, id);
  64. write_byte(id ? id : fake_user);
  65. write_string(msg);
  66. message_end();
  67. }
RAW Paste Data