seroff

Show Team [Friends] Money By Seroff

Jun 29th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. new g_maxplayers;
  5.  
  6. public plugin_init()
  7. {
  8. register_plugin("Show Team [Friends] Money","1.0","Seroff");
  9. register_event("HLTV", "NewRound", "a", "1=0", "2=0");
  10. g_maxplayers = get_maxplayers();
  11. }
  12.  
  13. public NewRound(){
  14. new id;
  15. for (id=1;id<33;id++){
  16. set_task(2.5,"check_money",id);
  17. }
  18. }
  19.  
  20. public check_money(id){
  21. static name[32];
  22. new money, client;
  23. for (client = 1; client <= g_maxplayers; client++)
  24. {
  25. if (client != id && is_user_connected(id) && is_user_connected(client) && cs_get_user_team(client) == cs_get_user_team(id))
  26. {
  27. money = cs_get_user_money(client);
  28. get_user_name(client, name, 31);
  29. ColorChat(id,"^3%s - ^1[^4%d^1]", name, money);
  30. }
  31. }
  32. }
  33.  
  34. stock ColorChat(const id, const input[], any:...)
  35. {
  36. new count = 1, players[32]
  37. static msg[191]
  38. vformat(msg, 190, input, 3)
  39.  
  40. replace_all(msg, 190, "!g", "^4") // Зелёный
  41. replace_all(msg, 190, "!n", "^1") // Стандартный
  42. replace_all(msg, 190, "!t", "^3") // Цвет команды
  43.  
  44. if (id) players[0] = id; else get_players(players, count, "ch")
  45. {
  46. for (new i = 0; i < count; i++)
  47. {
  48. if (is_user_connected(players[i]))
  49. {
  50. message_begin(MSG_ONE, get_user_msgid("SayText"), _, players[i])
  51. write_byte(players[i]);
  52. write_string(msg);
  53. message_end();
  54. }
  55. }
  56. }
  57. }
Add Comment
Please, Sign In to add comment