Guest User

Untitled

a guest
Apr 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <fakemeta>
  6.  
  7. #define PLUGIN "Mensajes cpo"
  8. #define VERSION "1.0"
  9. #define AUTHOR "........"
  10.  
  11. #define TASK_TUT 1111
  12.  
  13. enum
  14. {
  15. RED = 1,
  16. BLUE,
  17. YELLOW,
  18. GREEN
  19. }
  20.  
  21. enum CsTeams
  22. {
  23. CS_TEAM_UNASSIGNED = 0,
  24. CS_TEAM_T = 1,
  25. CS_TEAM_CT = 2,
  26. CS_TEAM_SPECTATOR = 3
  27. };
  28.  
  29. new const num_teams = 2;
  30. new g_MsgTutor,g_MsgTutClose,g_MsgTitle
  31.  
  32. //New Cvars
  33. new g_CvarCName,g_CvarMsg,g_CvarMsg2,g_MsgTime,g_MsgTime2
  34.  
  35. public plugin_init() {
  36. register_plugin(PLUGIN, VERSION, AUTHOR)
  37.  
  38. // Msg
  39. g_MsgTutor = get_user_msgid("TutorText")
  40. g_MsgTitle = get_user_msgid("GameTitle")
  41. g_MsgTutClose = get_user_msgid("TeamNames")
  42.  
  43. //Cvars
  44. g_CvarMsg = register_cvar("amx_notice_1","1 mensaje")
  45. g_CvarMsg2 = register_cvar("amx_notice_2","2 mensaje")
  46.  
  47. //Comunidadde
  48. g_CvarCName = register_cvar("amx_n_cname","o teu website")
  49.  
  50. //Tempo das mensajes
  51. g_MsgTime = register_cvar("amx_n_time_1","150.0")
  52. g_MsgTime2 = register_cvar("amx_n_time_2","250.0")
  53.  
  54. //Task
  55. set_task(get_pcvar_float(g_MsgTime),"CmdMsg")
  56. set_task(get_pcvar_float(g_MsgTime2),"CmdMsg2")
  57.  
  58.  
  59.  
  60. }
  61.  
  62.  
  63. public client_putinserver(id)
  64. {
  65. set_task(2.0,"CmdWelcomeMessage",id)
  66.  
  67. }
  68. public CmdWelcomeMessage(id)
  69. {
  70.  
  71. new Cname[200],targetname[32]
  72. get_user_name(id,targetname,31)
  73. get_pcvar_string(g_CvarCName, Cname, charsmax(Cname))
  74.  
  75. new Text[192]
  76.  
  77. formatex(Text,191,"%s Welcom To %s",targetname, Cname)
  78.  
  79. MsgWelcome(id,Text,YELLOW,10.0)
  80.  
  81. }
  82. public CmdMsg(id)
  83. {
  84. new message[200]
  85. get_pcvar_string(g_CvarMsg, message, charsmax(message))
  86. new Text1[192]
  87.  
  88. formatex(Text1,191,"%s", message)
  89.  
  90. MakeTutor(id,Text1,YELLOW,15.0)
  91.  
  92. }
  93. public CmdMsg2(id)
  94. {
  95. new message[200]
  96. get_pcvar_string(g_CvarMsg2, message, charsmax(message))
  97. new Text2[192]
  98.  
  99. formatex(Text2,191,"%s", message)
  100.  
  101. MakeTutor(id,Text2,YELLOW,15.0)
  102.  
  103. }
  104. MakeTutor(id,Text[],Color,Float:Time = 0.0) {
  105.  
  106. new Teamn[195]
  107. message_begin(MSG_ALL,g_MsgTutor,_,id)
  108. write_string(Text)
  109. write_byte(0)
  110. write_short(0)
  111. write_short(0)
  112. write_short(1<<2)
  113. message_end()
  114.  
  115.  
  116.  
  117. if(Time != 0.0) {
  118.  
  119. set_task(Time,"RemoveTutor",id + TASK_TUT)
  120. }
  121. }
  122. MsgWelcome(id,Text[],Color,Float:Time = 0.0) {
  123.  
  124. message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
  125. write_string(Text)
  126. write_byte(0)
  127. write_short(0)
  128. write_short(0)
  129. write_short(1<<2)
  130. message_end()
  131.  
  132.  
  133.  
  134. if(Time != 0.0) {
  135.  
  136. set_task(Time,"RemoveTutor",id + TASK_TUT)
  137. }
  138. }
  139. public RemoveTutor(taskID) {
  140.  
  141. new id = taskID - TASK_TUT
  142.  
  143.  
  144. message_begin(MSG_ALL,g_MsgTutClose,_,id)
  145. message_end()
  146. }
  147. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  148. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
  149. */
Add Comment
Please, Sign In to add comment