seroff

Steam Check [MOTD] By Seroff

Jun 22nd, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. #define ADMIN_LEVEL ADMIN_BAN
  5.  
  6. public plugin_init() {
  7. register_plugin("Steam Check [MOTD]", "1.0", "Seroff");
  8. register_clcmd("say /steam", "steamcheck");
  9. }
  10.  
  11. public steamcheck(id)
  12. {
  13. static motd[2000], len;
  14. len = 0;
  15. len += formatex(motd[len], charsmax(motd) - len,"<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>");
  16. len += formatex(motd[len], charsmax(motd) - len,"<STYLE>body{background:#4c5844;color:#d8ded3;font-family:sans-serif}table{width:100%%;line-height:160%%;font-size:12px}th{border:1px solid;border-color:#889180 #282e22 #282e22 #889180;background:#4c5844;color:#c4b550;padding-left:5px;font:normal;text-align:left}.q{border:1px solid;border-color:#282e22 #889180 #889180 #282e22}tr{background:#3e4637} div{text-align: center; }</STYLE>");
  17. len += formatex(motd[len], charsmax(motd) - len,"<body><p></p><center><table cellspacing=0 class=q>");
  18. if(!steam_num()){
  19. len += formatex(motd[len], charsmax(motd) - len,"<br><br><br><br><br><br><br><br> <caption><div style=^"margin: 15px;^"> <font size=^"5^" color=^"#c4b550^" > <b >Сейчас нет steam игроков</b></font></div><br></caption>");
  20. }
  21. else
  22. {
  23. len += formatex(motd[len], charsmax(motd) - len," <caption><div style=^"margin: 15px;^"> <font size=^"5^" color=^"#c4b550^" > <b >Количество steam игроков: %d</b></font></div><br></caption>",steam_num());
  24. len += formatex(motd[len], charsmax(motd) - len,"<tr><th style=^"width: 50%^"><div>#</div></th><th style=^"width: 50%^"><div>Имя</div></th> <th style=^"width:10%^"><div>SteamID</div></th> <th style=^"width:10%^"><div>Команда</div></th> </tr>");
  25. for(new i = 1, Name[32], colorteam[8],steamid[35], teamname[32]; i < get_maxplayers()+1; i++) {
  26. if(is_user_connected(i) && !(get_user_flags(i) & ADMIN_LEVEL) && is_user_steam(i)){
  27. get_user_name(i, Name, charsmax(Name));
  28. get_user_authid(i, steamid,charsmax(steamid));
  29. switch(cs_get_user_team(i))
  30. {
  31. case 0:{
  32. formatex(colorteam,charsmax(colorteam),"#FFFFFF");
  33. formatex(teamname,charsmax(teamname),"Ещё не определен");
  34. }
  35. case 1: {
  36. formatex(colorteam,charsmax(colorteam),"#E54234");
  37. formatex(teamname,charsmax(teamname),"Террорист");
  38. }
  39. case 2:{
  40. formatex(colorteam,charsmax(colorteam),"#90D6F4");
  41. formatex(teamname,charsmax(teamname),"Контр-Террорист");
  42. }
  43. case 3:{
  44. formatex(colorteam,charsmax(colorteam),"#FFFFFF");
  45. formatex(teamname,charsmax(teamname),"Наблюдатель");
  46. }
  47.  
  48. }
  49. len += formatex(motd[len], charsmax(motd) - len," <tr><br><td><div style=^"margin: 10px;^"><b>%d</b></div></td> <td><div style=^"margin: 10px;^"><b>%s</b></div></td> <td><div style=^"margin: 10px;^"><b>%s</b></div></td> <td><div style=^"margin: 10px;^"><font color=^"%s^"><b>%s</b></font> </div></td></tr>",i,Name,steamid,colorteam,teamname);
  50. }
  51. }
  52. }
  53. len += formatex(motd[len], charsmax(motd) - len,"</table>");
  54. len += formatex(motd[len], charsmax(motd) - len,"</center>");
  55. len += formatex(motd[len], charsmax(motd) - len," </body></html>");
  56. show_motd(id, motd, "Steam Online");
  57. }
  58.  
  59. stock steam_num(){
  60. static Num;
  61. Num=0;
  62. for(new i = 1; i < get_maxplayers(); i++) {
  63. if(is_user_connected(i) && !(get_user_flags(i) & ADMIN_LEVEL) && is_user_steam(i)){
  64. Num++;
  65. }
  66. }
  67. return Num
  68. }
  69.  
  70. stock bool:is_user_steam(id)
  71. {
  72. // Author Sh0oter
  73. static dp_pointer
  74. if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
  75. {
  76. server_cmd("dp_clientinfo %d", id)
  77. server_exec()
  78. return (get_pcvar_num(dp_pointer) == 2) ? true : false
  79. }
  80. return false
  81. }
Advertisement
Add Comment
Please, Sign In to add comment