Advertisement
Sokarbestfrag

Untitled

Feb 25th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN "Bomb bonus eXtream"
  6. #define VERSION "0.1"
  7. #define AUTHOR "S3eker"
  8.  
  9. new pBonus
  10. new dBonus
  11. new eBonus
  12.  
  13. new bool:g_IsConnected[ 33 ];
  14. new SayText, TeamInfo, g_maxplayers;
  15.  
  16. enum Color
  17. {
  18. NORMAL = 1,
  19. GREEN,
  20. TEAM_COLOR,
  21. GREY,
  22. RED,
  23. BLUE,
  24. }
  25.  
  26. new TeamName[ ][ ] =
  27. {
  28. "",
  29. "TERRORIST",
  30. "CT",
  31. "SPECTATOR"
  32. }
  33.  
  34. public plugin_init()
  35. {
  36. register_plugin(PLUGIN, VERSION, AUTHOR)
  37. register_event("TextMsg", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
  38. register_event("TextMsg", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
  39. register_event("TextMsg", "bomb_explode", "a", "2&#Target_B")
  40. pBonus = register_cvar("bmb_plant","1000")
  41. dBonus = register_cvar("bmb_defused","1000")
  42. eBonus = register_cvar("bmb_explode","500")
  43.  
  44. SayText = get_user_msgid ( "SayText" );
  45. TeamInfo = get_user_msgid ( "TeamInfo" );
  46. }
  47.  
  48. public bomb_planted(id)
  49. {
  50. new name[32]
  51. get_user_name(id, name, 31)
  52.  
  53. new money = cs_get_user_money(id)
  54. new got = get_pcvar_num(pBonus)
  55. cs_set_user_money(id, money + got)
  56. ColorChat ( 0, GREEN, "^x02* Jucatorul %s a primit 1000 $ pentru ca a plantat bomba !",name)
  57. }
  58.  
  59. public bomb_defused(id)
  60. {
  61. new name[32]
  62. get_user_name(id, name, 31)
  63.  
  64. new money = cs_get_user_money(id)
  65. new got = get_pcvar_num(dBonus)
  66. cs_set_user_money(id, money + got)
  67. ColorChat ( 0, GREEN, "^x02* Jucatorul %s a primit 1000 $ pentru ca a dezamorsat bomba !",name)
  68. }
  69.  
  70. public bomb_explode(id)
  71. {
  72. new name[32]
  73. get_user_name(id, name, 31)
  74.  
  75. new money = cs_get_user_money(id)
  76. new got = get_pcvar_num(eBonus)
  77. cs_set_user_money(id, money + got)
  78. ColorChat ( 0, GREEN, "^x02* Jucatorul %s a primit 500 $ pentru ca a avut grije ca bomba sa explodeze !",name)
  79. }
  80.  
  81. public ColorChat ( id, Color:type, const msg[], { Float, Sql, Result, _ }:... )
  82. {
  83. static message[ 256 ];
  84.  
  85. switch ( type )
  86. {
  87. case NORMAL:
  88. message[ 0 ] = 0x01;
  89. case GREEN:
  90. message[ 0 ] = 0x04;
  91. default:
  92. message[ 0 ] = 0x03;
  93. }
  94.  
  95. vformat ( message[ 1 ], 251, msg, 4 );
  96. message[ 192 ] = '^0';
  97.  
  98. new team, ColorChange, index, MSG_Type;
  99.  
  100. if ( id )
  101. {
  102. MSG_Type = MSG_ONE;
  103. index = id;
  104. }
  105. else
  106. {
  107. index = FindPlayer ( );
  108. MSG_Type = MSG_ALL;
  109. }
  110.  
  111. team = get_user_team ( index );
  112. ColorChange = ColorSelection ( index, MSG_Type, type );
  113.  
  114. ShowColorMessage ( index, MSG_Type, message );
  115.  
  116. if ( ColorChange )
  117. Team_Info ( index, MSG_Type, TeamName[ team ] );
  118. }
  119.  
  120. ShowColorMessage ( id, type, message[] )
  121. {
  122. message_begin ( type, SayText, _, id );
  123. write_byte ( id )
  124. write_string ( message );
  125. message_end ( );
  126. }
  127.  
  128. Team_Info ( id, type, team[] )
  129. {
  130. message_begin ( type, TeamInfo, _, id );
  131. write_byte ( id );
  132. write_string ( team );
  133. message_end ( );
  134.  
  135. return 1;
  136. }
  137.  
  138. ColorSelection ( index, type, Color:Type )
  139. {
  140. switch ( Type )
  141. {
  142. case RED:
  143. return Team_Info ( index, type, TeamName[ 1 ] );
  144. case BLUE:
  145. return Team_Info ( index, type, TeamName[ 2 ] );
  146. case GREY:
  147. return Team_Info ( index, type, TeamName[ 0 ] );
  148. }
  149. return 0;
  150. }
  151.  
  152. public FindPlayer ( )
  153. {
  154. for ( new i = 1; i <= g_maxplayers; i++ )
  155. if ( g_IsConnected[ i ] )
  156. return i;
  157.  
  158. return -1;
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement