hlmod.hu
https://hlmod.hu/

[VIP]
https://hlmod.hu/viewtopic.php?f=9&t=6317
Oldal: 1 / 1

Szerző:  pixxa112 [2012.10.16. 16:15 ]
Hozzászólás témája:  [VIP]

Hali.

Bocsi a dupla postért :S
Ez a kód a jó??

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <fakemeta_util>
  4. #include <hamsandwich>
  5. #include <cstrike>
  6. #include <amxmisc>
  7. #include <fun>
  8. #include <colorchat>
  9.  
  10. #define PLUGIN_NAME "vipas"
  11. #define PLUGIN_AUTHOR "Kukulis"
  12. #define PLUGIN_VERSION "0.1"
  13. #define FLAG ADMIN_LEVEL_H
  14.  
  15. static const COLOR[] = "^x04"
  16. static const CONTACT[] = ""
  17.  
  18. new maxplayers
  19. new gmsgSayText
  20.  
  21. public plugin_init()
  22. {
  23. register_plugin(PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION);
  24.  
  25. register_event("ResetHUD","event_reset_hud","be");
  26. register_event("ResetHUD", "resetModel", "b")
  27. register_clcmd("say /vip","admin_motd",1,"- Shows the MOTD.")
  28.  
  29. register_message(get_user_msgid("SayText"),"Tekst");
  30. register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");
  31.  
  32.  
  33. register_clcmd("say", "handle_say")
  34. register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
  35. gmsgSayText = get_user_msgid("SayText")
  36.  
  37. maxplayers = get_maxplayers()
  38.  
  39. return PLUGIN_CONTINUE
  40.  
  41. }
  42.  
  43. public plugin_precache() {
  44. precache_model("models/player/eb@_vip_ct/eb@_vip_ct.mdl")
  45. precache_model("models/player/eb@_vip_te/eb@_vip_te.mdl")
  46.  
  47. return PLUGIN_CONTINUE
  48. }
  49.  
  50. public resetModel(id, level, cid) {
  51. if (get_user_flags(id) & ADMIN_CHAT) {
  52. new CsTeams:userTeam = cs_get_user_team(id)
  53. if (userTeam == CS_TEAM_T) {
  54. cs_set_user_model(id, "eb@_vip_te")
  55. }
  56. else if(userTeam == CS_TEAM_CT) {
  57. cs_set_user_model(id, "eb@_vip_ct")
  58. }
  59. else {
  60. cs_reset_user_model(id)
  61. }
  62. }
  63.  
  64. return PLUGIN_CONTINUE
  65. }
  66.  
  67.  
  68. public event_reset_hud(id)
  69. {
  70. if(!is_user_connected(id))
  71. return PLUGIN_CONTINUE;
  72.  
  73. ColorChat(id, GREEN, "[VIP] ^1* Írd vip hogy lássd mit tud a ^4VIP ^1!!")
  74.  
  75. if(!access(id,ADMIN_CHAT))
  76. return PLUGIN_CONTINUE;
  77.  
  78. set_task(1.0,"give_stuff",id);
  79.  
  80. return PLUGIN_CONTINUE;
  81. }
  82.  
  83. public admin_motd(id,level,cid) {
  84.  
  85. if (!cmd_access(id,level,cid,1))
  86. return PLUGIN_CONTINUE
  87.  
  88. show_motd(id,"vip.txt","VIP by Kukulis")
  89. return PLUGIN_CONTINUE
  90. }
  91.  
  92.  
  93.  
  94.  
  95. public give_stuff(id)
  96. {
  97. if(!is_user_connected(id))
  98. return;
  99.  
  100. fm_give_item(id, "item_assaultsuit");
  101. fm_give_item(id, "weapon_flashbang");
  102. fm_give_item(id, "weapon_flashbang");
  103. fm_give_item(id, "weapon_hegrenade");
  104. fm_give_item(id, "weapon_smokegrenade");
  105. cs_set_user_money(id, cs_get_user_money(id) + 500);
  106. set_user_gravity (id, 0.70);
  107. }
  108.  
  109. public handle_say(id)
  110. {
  111. new said[192]
  112. read_args(said,192)
  113. if(( containi(said, "who") != -1 && containi(said, "admin") != -1) || contain(said, "/vips") != -1)
  114. set_task(0.1,"print_viplist", id)
  115. return PLUGIN_CONTINUE
  116. }
  117.  
  118. public print_viplist(user)
  119. {
  120. new adminnames[33][32]
  121. new message[256]
  122. new contactinfo[256], contact[112]
  123. new id, count, x, len
  124.  
  125. for(id = 1 ; id <= maxplayers ; id++)
  126. if(is_user_connected(id))
  127. if(get_user_flags(id) & ADMIN_CHAT)
  128. get_user_name(id, adminnames[count++], 31)
  129.  
  130. len = format(message, 255, "%s * [<<eb@>>] Jelenlévő vip(ek): ",COLOR)
  131. if(count > 0) {
  132. for(x = 0 ; x < count ; x++) {
  133. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  134. if(len > 96 ) {
  135. print_message(user, message)
  136. len = format(message, 255, "%s ",COLOR)
  137. }
  138. }
  139. print_message(user, message)
  140. }
  141. else {
  142. len += format(message[len], 255-len, "* [<<eb@>>] Nincs Jelenlévő vip(ek).")
  143. print_message(user, message)
  144. }
  145.  
  146. get_cvar_string("amx_contactinfo", contact, 63)
  147. if(contact[0]) {
  148. format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  149. print_message(user, contactinfo)
  150. }
  151. }
  152.  
  153. print_message(id, msg[])
  154. {
  155. message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  156. write_byte(id)
  157. write_string(msg)
  158. message_end()
  159. }
  160.  
  161. public Tekst(msgId,msgDest,msgEnt){
  162. new id = get_msg_arg_int(1);
  163. if(!is_user_connected(id)) return PLUGIN_CONTINUE;
  164. if(get_user_flags(id) & FLAG)
  165. {
  166. new szTmp[256],szTmp2[256];
  167. get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
  168. new szPrefix[64] = "^x04[VIP]";
  169. if(!equal(szTmp,"#Cstrike_Chat_All")){
  170. add(szTmp2,charsmax(szTmp2),szPrefix);
  171. add(szTmp2,charsmax(szTmp2)," ");
  172. add(szTmp2,charsmax(szTmp2),szTmp);
  173. }
  174. else{
  175. add(szTmp2,charsmax(szTmp2),szPrefix);
  176. add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : ^x04%s2");
  177. }
  178. set_msg_arg_string(2,szTmp2);
  179. }
  180. return PLUGIN_CONTINUE;
  181. }
  182.  
  183. public client_putinserver(pID)
  184. {
  185. set_task(0.3, "vip_connect", pID);
  186. }
  187.  
  188. public vip_connect(pID)
  189. {
  190. if(get_user_flags(pID) & ADMIN_LEVEL_H)
  191. {
  192. connect_hud(pID)
  193. client_cmd(0, "stopsound")
  194. client_cmd(0, "spk %s", CON_SOUND)
  195. }
  196. }
  197.  
  198. public connect_hud(pID)
  199. {
  200. new name[32]
  201. get_user_name(pID, name, 31)
  202.  
  203.  
  204. new r = random(255)
  205. new g = random(255)
  206. new b = random(255)
  207.  
  208. set_hudmessage(r, g, b, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)
  209. show_hudmessage(0, "Egy V.I.P csatlakozott a szerverre! Neve: ", name)
  210. }
  211.  
  212. public plugin_precache()
  213. {
  214. precache_sound("misc/admin/admin.wav")
  215. }

Szerző:  Nandee [2012.10.16. 16:43 ]
Hozzászólás témája:  Re: [VIP]

Plugin próbája az evés! xD
Am szerintem jó :D

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/