Advertisement
Guest User

Untitled

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