hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.16. 23:45



Jelenlévő felhasználók

Jelenleg 377 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 376 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: slay_kase | amx_warn
HozzászólásElküldve:2012.09.09. 17:29 
Offline
Őskövület
Avatar

Csatlakozott:2011.12.28. 00:35
Hozzászólások:2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Hali.

Valaki lebírná fordítani?? PLS

ez 2 plugin mit csinál?

Slay_kase
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <colorchat>
  4. #include <nvault>
  5.  
  6. #define PLUGIN "SayKlase"
  7. #define VERSION "1.2"
  8. #define AUTHOR "BS"
  9.  
  10. #define ADMIN_FLAG ADMIN_BAN
  11.  
  12. new const haha[] = "addons/amxmodx/configs/SayKlasePodesavanja.cfg"
  13.  
  14. enum Cvarovi
  15. {
  16. HUD_INFO, PRVA_PREFIX, PRVA_MAX, DRUGA_PREFIX, DRUGA_MIN, DRUGA_MAX, TRECA_PREFIX,
  17. TRECA_MIN, TRECA_MAX, CETVRTA_PREFIX, CETVRTA_MIN, CETVRTA_MAX, PETA_PREFIX, PETA_MIN, PETA_MAX,
  18. SESTA_PREFIX, SESTA_MIN, SESTA_MAX, SEDMA_PREFIX, SEDMA_MIN, SEDMA_MAX, OSMA_PREFIX,
  19. OSMA_MIN, OSMA_MAX, DEVETA_PREFIX, DEVETA_MIN, DEVETA_MAX, DESETA_PREFIX, DESETA_MIN, DESETA_ADMIN
  20. }
  21.  
  22. new const g_ImenaCvarova[ Cvarovi ][] =
  23. {
  24. "hud_info", "prva_prefix", "prva_max", "druga_prefix", "druga_min", "druga_max","treca_prefix",
  25. "treca_min", "treca_max", "cetvrta_prefix", "cetvrta_min", "cetvrta_max", "peta_prefix", "peta_min", "peta_max",
  26. "sesta_prefix", "sesta_min", "sesta_max", "sedma_prefix", "sedma_min", "sedma_max", "osma_prefix",
  27. "osma_min", "osma_max", "deveta_prefix", "deveta_min", "deveta_max", "deseta_prefix", "deseta_min", "deseta_admin"
  28. };
  29.  
  30. new const g_DefaultVrednost[ Cvarovi ][] =
  31. {
  32. "1", "Botina", "40", "Bot", "41", "80", "Pocetnik",
  33. "81", "150", "Nov igrac", "151", "350", "Not Bad", "351", "500",
  34. "Iskusan", "501", "600", "Pro", "601", "700", "Supermen",
  35. "701", "850", "Godlike", "851", "1000", "Legend of", "1001", "1"
  36. };
  37.  
  38. new g_SviCvarovi[ Cvarovi ];
  39.  
  40. new ubistva, prefix[33], koja[33] = 1
  41. new steam[32], ip[33], killovi[33]
  42.  
  43. static HostName[33]
  44.  
  45. public plugin_init()
  46. {
  47. register_plugin(PLUGIN, VERSION, AUTHOR)
  48. register_cvar("sayklase","1",(FCVAR_SERVER|FCVAR_SPONLY))
  49.  
  50. server_cmd("exec %s", haha)
  51. ubistva = nvault_open("ubistva")
  52. register_event("DeathMsg", "Death", "a")
  53.  
  54. for ( new Cvarovi:i = HUD_INFO ; i < Cvarovi ; i++ )
  55. g_SviCvarovi[ i ] = register_cvar( g_ImenaCvarova[ i ] , g_DefaultVrednost[ i ] );
  56.  
  57. register_concmd("amx_reset_klasu","resetuj",ADMIN_FLAG,"<nick> - Resetuje igracevu klasu")
  58. register_clcmd("say","kazi")
  59. }
  60.  
  61. public plugin_precache()
  62. {
  63.  
  64. if(!file_exists(haha))
  65. {
  66. write_file(haha,"U ovom fajlu nalaze se podesavanja klasa na Say komandi")
  67. write_file(haha,"==========================================================")
  68. write_file(haha," ")
  69. write_file(haha,"hud_info ^"1^" // Da li ce igracima pisati hud porukom klasa i broj ubistava")
  70. write_file(haha," ")
  71. write_file(haha,"prva_prefix ^"Botina^" // Prefiks klase")
  72. write_file(haha,"prva_max ^"40^" // Najvise ubistava za ovu klasu")
  73. write_file(haha," ")
  74. write_file(haha,"druga_prefix ^"Bot^" // Prefiks klase")
  75. write_file(haha,"druga_min ^"41^" // Najmanje ubistava za ovu klasu")
  76. write_file(haha,"druga_max ^"80^" // Najvise ubistava za ovu klasu")
  77. write_file(haha," ")
  78. write_file(haha,"treca_prefix ^"Pocetnik^" // Prefiks klase")
  79. write_file(haha,"treca_min ^"81^" // Najmanje ubistava za ovu klasu")
  80. write_file(haha,"treca_max ^"150^" // Najvise ubistava za ovu klasu")
  81. write_file(haha," ")
  82. write_file(haha,"cetvrta_prefix ^"Nov Igrac^" // Prefiks klase")
  83. write_file(haha,"cetvrta_min ^"151^" // Najmanje ubistava za ovu klasu")
  84. write_file(haha,"cetvrta_max ^"350^" // Najvise ubistava za ovu klasu")
  85. write_file(haha," ")
  86. write_file(haha,"peta_prefix ^"Not Bad^" // Prefiks klase")
  87. write_file(haha,"peta_min ^"351^" // Najmanje ubistava za ovu klasu")
  88. write_file(haha,"peta_max ^"500^" // Najvise ubistava za ovu klasu")
  89. write_file(haha," ")
  90. write_file(haha,"sesta_prefix ^"Iskusan^" // Prefiks klase")
  91. write_file(haha,"sesta_min ^"501^" // Najmanje ubistava za ovu klasu")
  92. write_file(haha,"sesta_max ^"600^" // Najvise ubistava za ovu klasu")
  93. write_file(haha," ")
  94. write_file(haha,"sedma_prefix ^"Pro^" // Prefiks klase")
  95. write_file(haha,"sedma_min ^"601^" // Najmanje ubistava za ovu klasu")
  96. write_file(haha,"sedma_max ^"700^" // Najvise ubistava za ovu klasu")
  97. write_file(haha," ")
  98. write_file(haha,"osma_prefix ^"Supermen^" // Prefiks klase")
  99. write_file(haha,"osma_min ^"701^" // Najmanje ubistava za ovu klasu")
  100. write_file(haha,"osma_max ^"850^" // Najvise ubistava za ovu klasu")
  101. write_file(haha," ")
  102. write_file(haha,"deveta_prefix ^"Godlike^" // Prefiks klase")
  103. write_file(haha,"deveta_min ^"851^" // Najmanje ubistava za ovu klasu")
  104. write_file(haha,"deveta_max ^"1000^" // Najvise ubistava za ovu klasu")
  105. write_file(haha," ")
  106. write_file(haha,"deseta_prefix ^"Legend of^" // Prefiks klase")
  107. write_file(haha,"deseta_min ^"1001^" // Najmanje ubistava za ovu klasu")
  108. write_file(haha,"deseta_admin ^"1^" // Da li ce igraci ove (najbolje) klase imati Zeleni Say, 1 = ON | 0 = OFF")
  109. }
  110. }
  111.  
  112. public client_disconnect(id)
  113. {
  114. get_user_authid(id,steam,charsmax(steam))
  115. if(equali(steam, "VALVE_ID_LAN"))
  116. {
  117. get_user_ip(id,ip,charsmax(ip))
  118. nvault_set(ubistva,ip,killovi[id])
  119. }
  120. else
  121. nvault_set(ubistva,steam,killovi[id])
  122.  
  123. koja[id] = 0
  124. killovi[id] = 0
  125. }
  126.  
  127. public Death()
  128. {
  129. new attacker = read_data(1)
  130. if(attacker > get_maxplayers())
  131. return;
  132. killovi[attacker]++
  133. }
  134.  
  135. public client_putinserver(id)
  136. {
  137. set_task(10.0,"reklamaa",id)
  138.  
  139. get_user_authid(id,steam,charsmax(steam))
  140. if(equali(steam, "VALVE_ID_LAN"))
  141. {
  142. get_user_ip(id,ip,charsmax(ip))
  143. nvault_get(ubistva,ip,killovi[id],31)
  144. }
  145. else
  146. nvault_get(ubistva,steam,killovi[id],31)
  147.  
  148. if(killovi[id] <= get_pcvar_num( g_SviCvarovi[ PRVA_MAX ] ))
  149. koja[id] = 1
  150. else if(get_pcvar_num( g_SviCvarovi[ DRUGA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ DRUGA_MAX ] ))
  151. koja[id] = 2
  152. else if(get_pcvar_num( g_SviCvarovi[ TRECA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ TRECA_MAX ] ))
  153. koja[id] = 3
  154. else if(get_pcvar_num( g_SviCvarovi[ CETVRTA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ CETVRTA_MAX ] ))
  155. koja[id] = 4
  156. else if(get_pcvar_num( g_SviCvarovi[ PETA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ PETA_MAX ] ))
  157. koja[id] = 5
  158. else if(get_pcvar_num( g_SviCvarovi[ SESTA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ SESTA_MAX ] ))
  159. koja[id] = 6
  160. else if(get_pcvar_num( g_SviCvarovi[ SEDMA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ SEDMA_MAX ] ))
  161. koja[id] = 7
  162. else if(get_pcvar_num( g_SviCvarovi[ OSMA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ OSMA_MAX ] ))
  163. koja[id] = 8
  164. else if(get_pcvar_num( g_SviCvarovi[ DEVETA_MIN ] ) <= killovi[id] < get_pcvar_num( g_SviCvarovi[ DEVETA_MAX ] ))
  165. koja[id] = 9
  166. else if(killovi[id] >= get_pcvar_num( g_SviCvarovi[ DESETA_MIN ] ))
  167. koja[id] = 10
  168.  
  169. if(get_pcvar_num( g_SviCvarovi[ HUD_INFO ] ) == 1)
  170. set_task(5.0,"hud",id)
  171. }
  172.  
  173. public hud(id)
  174. {
  175. if(!is_user_connected(id))
  176. return PLUGIN_HANDLED
  177.  
  178. set_hudmessage(0, 255, 0, 0.02, 0.19, 0, 6.0, 12.0)
  179. switch(koja[id])
  180. {
  181. case 1:
  182. {
  183. get_pcvar_string(g_SviCvarovi[ PRVA_PREFIX ], prefix,charsmax(prefix))
  184. show_hudmessage(id, "Klasa: [%s] ^n1 / 10^n[%s]: 0 - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ PRVA_MAX ] ),killovi[id])
  185. }
  186. case 2:
  187. {
  188. get_pcvar_string(g_SviCvarovi[ DRUGA_PREFIX ],prefix,charsmax(prefix))
  189. show_hudmessage(id, "Klasa: [%s] ^n2 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ DRUGA_MIN ] ),get_cvar_num( g_SviCvarovi[ DRUGA_MAX ] ),killovi[id])
  190. }
  191. case 3:
  192. {
  193. get_cvar_string(g_SviCvarovi[ TRECA_PREFIX ],prefix,charsmax(prefix))
  194. show_hudmessage(id, "Klasa: [%s] ^n3 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ TRECA_MIN ] ),get_cvar_num( g_SviCvarovi[ TRECA_MAX ] ),killovi[id])
  195. }
  196. case 4:
  197. {
  198. get_pcvar_string(g_SviCvarovi[ CETVRTA_PREFIX ],prefix,charsmax(prefix))
  199. show_hudmessage(id, "Klasa: [%s] ^n4 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ CETVRTA_MIN ] ),get_cvar_num( g_SviCvarovi[ CETVRTA_MAX ] ),killovi[id])
  200. }
  201. case 5:
  202. {
  203. get_pcvar_string(g_SviCvarovi[ PETA_PREFIX ],prefix,charsmax(prefix))
  204. show_hudmessage(id, "Klasa: [%s] ^n5 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ PETA_MIN ] ),get_cvar_num( g_SviCvarovi[ PETA_MAX ] ),killovi[id])
  205. }
  206. case 6:
  207. {
  208. get_pcvar_string(g_SviCvarovi[ SESTA_PREFIX ],prefix,charsmax(prefix))
  209. show_hudmessage(id, "Klasa: [%s] ^n6 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ SESTA_MIN ] ),get_cvar_num( g_SviCvarovi[ SESTA_MAX ] ),killovi[id])
  210. }
  211. case 7:
  212. {
  213. get_pcvar_string(g_SviCvarovi[ SEDMA_PREFIX ],prefix,charsmax(prefix))
  214. show_hudmessage(id, "Klasa: [%s] ^n7 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ SEDMA_MIN ] ),get_cvar_num( g_SviCvarovi[ SEDMA_MAX ] ),killovi[id])
  215. }
  216. case 8:
  217. {
  218. get_pcvar_string(g_SviCvarovi[ OSMA_PREFIX ],prefix,charsmax(prefix))
  219. show_hudmessage(id, "Klasa: [%s] ^n8 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ OSMA_MIN ] ),get_cvar_num( g_SviCvarovi[ OSMA_MAX ] ),killovi[id])
  220. }
  221. case 9:
  222. {
  223. get_pcvar_string(g_SviCvarovi[ DEVETA_PREFIX ],prefix,charsmax(prefix))
  224. show_hudmessage(id, "Klasa: [%s] ^n9 / 10^n[%s]: %i - %i ^nUbistava: [%i]",prefix,prefix,get_pcvar_num( g_SviCvarovi[ DEVETA_MIN ] ),get_cvar_num( g_SviCvarovi[ DEVETA_MAX ] ),killovi[id])
  225. }
  226. case 10:
  227. {
  228. get_cvar_string("hostname",HostName,charsmax(HostName))
  229. get_pcvar_string(g_SviCvarovi[ DESETA_PREFIX ],prefix,charsmax(prefix))
  230. show_hudmessage(id, "Klasa: [%s %s] ^n10 / 10^n[%s %s]: %i - Besk. ^nUbistava: [%i]",prefix,HostName,prefix,HostName,get_pcvar_num( g_SviCvarovi[ DESETA_MIN ] ),killovi[id])
  231. }
  232. }
  233.  
  234. set_task(5.0,"hud",id)
  235. return PLUGIN_CONTINUE;
  236. }
  237.  
  238. public kazi(id)
  239. {
  240. new kaze[191],ime[33]
  241. read_args(kaze,charsmax(kaze))
  242. remove_quotes(kaze)
  243. get_user_name(id,ime,charsmax(ime))
  244. switch(koja[id])
  245. {
  246. case 1: get_pcvar_string(g_SviCvarovi[ PRVA_PREFIX ], prefix,charsmax(prefix))
  247. case 2: get_pcvar_string(g_SviCvarovi[ DRUGA_PREFIX ],prefix,charsmax(prefix))
  248. case 3: get_pcvar_string(g_SviCvarovi[ TRECA_PREFIX ],prefix,charsmax(prefix))
  249. case 4: get_pcvar_string(g_SviCvarovi[ CETVRTA_PREFIX ],prefix,charsmax(prefix))
  250. case 5: get_pcvar_string(g_SviCvarovi[ PETA_PREFIX ],prefix,charsmax(prefix))
  251. case 6: get_pcvar_string(g_SviCvarovi[ SESTA_PREFIX ],prefix,charsmax(prefix))
  252. case 7: get_pcvar_string(g_SviCvarovi[ SEDMA_PREFIX ],prefix,charsmax(prefix))
  253. case 8: get_pcvar_string(g_SviCvarovi[ OSMA_PREFIX ],prefix,charsmax(prefix))
  254. case 9: get_pcvar_string(g_SviCvarovi[ DEVETA_PREFIX ],prefix,charsmax(prefix))
  255. case 10: get_pcvar_string(g_SviCvarovi[ DESETA_PREFIX ],prefix,charsmax(prefix))
  256. }
  257. switch(koja[id])
  258. {
  259. case 1..9:
  260. ColorChat(0,TEAM_COLOR,"^4[%s]^3 %s^1 : %s",prefix,ime,kaze)
  261.  
  262. case 10:
  263. {
  264. get_cvar_string("hostname",HostName,charsmax(HostName))
  265.  
  266. if(get_pcvar_num( g_SviCvarovi[ DESETA_ADMIN ] ) == 1)
  267. ColorChat(0,TEAM_COLOR,"^4[%s %s]^3 %s^1 :^4 %s",prefix,HostName,ime,kaze)
  268. else
  269. ColorChat(0,TEAM_COLOR,"^4[%s %s]^3 %s^1 : %s",prefix,HostName,ime,kaze)
  270. }
  271. }
  272. return PLUGIN_HANDLED
  273. }
  274.  
  275. public resetuj(id,level,cid)
  276. {
  277. if(!cmd_access(id,level,cid,2))
  278. return PLUGIN_HANDLED
  279. new arg[32]
  280. read_argv(1, arg, charsmax(arg))
  281. new igrac = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF | CMDTARGET_OBEY_IMMUNITY)
  282. if(!is_user_connected(igrac))
  283. return PLUGIN_HANDLED
  284. new name[28], admin[28]
  285. get_user_name(id, admin, charsmax(admin))
  286. get_user_name(igrac, name, charsmax(name))
  287. ColorChat(0,TEAM_COLOR,"^4[Klase]^1 Admin^3 %s^1 je resetovao klasu^3 %s",admin,name)
  288. killovi[igrac] = 0
  289. koja[id] = 1
  290. return PLUGIN_HANDLED
  291. }
  292.  
  293. public reklamaa(id)
  294. ColorChat(id,TEAM_COLOR,"^4[Klase]^1 Ovaj server koristi^4 Say Klase Plugin^1 By:^3 BS")

 



amx_warn <-- ez mitől másabb ban menu mint az alap?
SMA Forráskód: [ Mindet kijelol ]
  1. #define SQLON 0 // 1 = Use SQL | 0 = Use file
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #if SQLON
  7. #include <dbi>
  8. #endif
  9.  
  10. #if SQLON
  11. new Sql:dbc
  12. new Result:result
  13. #else
  14. new filepath[251]
  15. #endif
  16.  
  17. new g_MsgScreenFade
  18. new playerwarnings[32]
  19. new swarnlevel[33]
  20. new warned[33][33]
  21.  
  22. public plugin_init()
  23. {
  24. register_plugin("AMX Warn","1.71","twistedeuphoria")
  25. register_concmd("amx_warn","swarn",ADMIN_BAN,"<username>")
  26. register_concmd("amx_unwarn","unswarn",ADMIN_BAN,"<username>")
  27. register_concmd("warn","playerwarn",ADMIN_USER,"<username> If enough players warn a player that player's warning level will be increased.")
  28. register_cvar("amx_warn_lvl1","0") // 0 = message 1 = slap 2 = slay 3 = kick 4 = temp ban 5 = perma ban
  29. register_cvar("amx_warn_lvl2","1")
  30. register_cvar("amx_warn_lvl3","2")
  31. register_cvar("amx_warn_lvl4","3")
  32. register_cvar("amx_warn_lvl5","4")
  33. register_cvar("amx_slap_lvl1dmg","5")
  34. register_cvar("amx_slap_lvl2dmg","5")
  35. register_cvar("amx_slap_lvl3dmg","5")
  36. register_cvar("amx_slap_lvl4dmg","5")
  37. register_cvar("amx_slap_lvl5dmg","5")
  38. register_cvar("amx_tempban_lvl1time","5")
  39. register_cvar("amx_tempban_lvl2time","5")
  40. register_cvar("amx_tempban_lvl3time","5")
  41. register_cvar("amx_tempban_lvl4time","5")
  42. register_cvar("amx_tempban_lvl5time","5")
  43. register_cvar("amx_warn_flash","1") // 1 = Red 2 = White 3 = Random
  44. register_cvar("amx_playerwarn_ratio","0.5")
  45. register_cvar("amx_playerwarn_allow","1")
  46. register_cvar("amx_savewarns","1")
  47. #if SQLON
  48. set_task(3.0,"sqlinit")
  49. #else
  50. new directory[201]
  51. get_datadir(directory,200)
  52. format(filepath,251,"%s/warned.txt",directory)
  53. if(!file_exists(filepath))
  54. {
  55. new writestr[51]
  56. format(writestr,50,"Warns will be saved in here.")
  57. write_file(filepath,writestr)
  58. }
  59. #endif
  60. }
  61.  
  62. #if SQLON
  63. public sqlinit()
  64. {
  65. new error[32],sqlhostname[35],sqluser[35],sqlpass[35],sqldbname[35]
  66. get_cvar_string("amx_sql_host",sqlhostname,34)
  67. get_cvar_string("amx_sql_user",sqluser,34)
  68. get_cvar_string("amx_sql_pass",sqlpass,34)
  69. get_cvar_string("amx_sql_db",sqldbname,34)
  70. dbc = dbi_connect(sqlhostname,sqluser,sqlpass,sqldbname,error,31)
  71. if(dbc == SQL_FAILED)
  72. {
  73. server_print("[AMX Warn]Could not connect to database.")
  74. return PLUGIN_HANDLED
  75. }
  76. result = dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `amxwarn` (`authid` VARCHAR(35), `warnlevel` TINYINT)")
  77. dbi_free_result(result)
  78. return PLUGIN_HANDLED
  79. }
  80. #endif
  81.  
  82. public swarn(id,level,cid)
  83. {
  84. if(!cmd_access(id,level,cid,2))
  85. return PLUGIN_HANDLED
  86. new target[32],tid,suid,name[32]
  87. read_args(target,31)
  88. tid = cmd_target(id,target,1)
  89. if(!tid)
  90. return PLUGIN_HANDLED
  91. suid = get_user_userid(tid)
  92. get_user_name(tid,name,31)
  93. flash(tid)
  94. swarnlevel[tid]++
  95. switch(swarnlevel[tid])
  96. {
  97. case 1:
  98. {
  99. new punishment
  100. punishment = get_cvar_num("amx_warn_lvl1")
  101. switch(punishment)
  102. {
  103. case 0:
  104. client_print(tid,print_center,"You have been warned by an admin. Do not continue your actions.")
  105. case 1:
  106. {
  107. new slapdmg = get_cvar_num("amx_slap_lvl1dmg")
  108. user_slap(tid,slapdmg)
  109. client_print(tid,print_center,"You have been warned by an admin. Do not continue your actions.")
  110. }
  111. case 2:
  112. {
  113. user_kill(tid)
  114. client_print(tid,print_center,"You have been warned by an admin. Do not continue your actions.")
  115. }
  116. case 3:
  117. server_cmd("kick #%d",suid)
  118. case 4:
  119. {
  120. new banlength
  121. banlength = get_cvar_num("amx_tempban_lvl1time")
  122. server_cmd("banid %d #%d kick",banlength,suid)
  123. }
  124. case 5:
  125. server_cmd("banid 0 #%d kick",suid)
  126. }
  127. }
  128. case 2:
  129. {
  130. new punishment
  131. punishment = get_cvar_num("amx_warn_lvl2")
  132. switch(punishment)
  133. {
  134. case 0:
  135. client_print(tid,print_center,"You have been warned twice by an admin. Do not continue your actions.")
  136. case 1:
  137. {
  138. new slapdmg = get_cvar_num("amx_slap_lvl2dmg")
  139. user_slap(tid,slapdmg)
  140. client_print(tid,print_center,"You have been warned twice by an admin. Do not continue your actions.")
  141. }
  142. case 2:
  143. {
  144. user_kill(tid)
  145. client_print(tid,print_center,"You have been warned twice by an admin. Do not continue your actions.")
  146. }
  147. case 3:
  148. server_cmd("kick #%d",suid)
  149. case 4:
  150. {
  151. new banlength
  152. banlength = get_cvar_num("amx_tempban_lvl2time")
  153. server_cmd("banid %d #%d kick",banlength,suid)
  154. }
  155. case 5:
  156. server_cmd("banid 0 #%d kick",suid)
  157. }
  158. }
  159. case 3:
  160. {
  161. new punishment
  162. punishment = get_cvar_num("amx_warn_lvl3")
  163. switch(punishment)
  164. {
  165. case 0:
  166. client_print(tid,print_center,"You have been warned three times by an admin. Do not continue your actions.")
  167. case 1:
  168. {
  169. new slapdmg = get_cvar_num("amx_slap_lvl3dmg")
  170. user_slap(tid,slapdmg)
  171. client_print(tid,print_center,"You have been warned three times by an admin. Do not continue your actions.")
  172. }
  173. case 2:
  174. {
  175. user_kill(tid)
  176. client_print(tid,print_center,"You have been warned three times by an admin. Do not continue your actions.")
  177. }
  178. case 3:
  179. server_cmd("kick #%d",suid)
  180. case 4:
  181. {
  182. new banlength
  183. banlength = get_cvar_num("amx_tempban_lvl3time")
  184. server_cmd("banid %d #%d kick",banlength,suid)
  185. }
  186. case 5:
  187. server_cmd("banid 0 #%d kick",suid)
  188. }
  189. }
  190. case 4:
  191. {
  192. new punishment
  193. punishment = get_cvar_num("amx_warn_lvl4")
  194. switch(punishment)
  195. {
  196. case 0:
  197. client_print(tid,print_center,"You have been warned four times by an admin. Do not continue your actions.")
  198. case 1:
  199. {
  200. new slapdmg = get_cvar_num("amx_slap_lvl4dmg")
  201. user_slap(tid,slapdmg)
  202. client_print(tid,print_center,"You have been warned four times by an admin. Do not continue your actions.")
  203. }
  204. case 2:
  205. {
  206. user_kill(tid)
  207. client_print(tid,print_center,"You have been warned four times by an admin. Do not continue your actions.")
  208. }
  209. case 3:
  210. server_cmd("kick #%d",suid)
  211. case 4:
  212. {
  213. new banlength
  214. banlength = get_cvar_num("amx_tempban_lvl4time")
  215. server_cmd("banid %d #%d kick",banlength,suid)
  216. }
  217. case 5:
  218. server_cmd("banid 0 #%d kick",suid)
  219. }
  220. }
  221. default:
  222. {
  223. new punishment
  224. punishment = get_cvar_num("amx_warn_lvl5")
  225. switch(punishment)
  226. {
  227. case 0:
  228. client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
  229. case 1:
  230. {
  231. new slapdmg = get_cvar_num("amx_slap_lvl5dmg")
  232. user_slap(tid,slapdmg)
  233. client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
  234. }
  235. case 2:
  236. {
  237. user_kill(tid)
  238. client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
  239. }
  240. case 3:
  241. server_cmd("kick #%d",suid)
  242. case 4:
  243. {
  244. new banlength
  245. banlength = get_cvar_num("amx_tempban_lvl5time")
  246. server_cmd("banid %d #%d kick",banlength,suid)
  247. }
  248. case 5:
  249. server_cmd("banid 0 #%d kick",suid)
  250. }
  251. }
  252. }
  253. console_print(id,"%s has been successfully warned.",name)
  254. new authid[35]
  255. get_user_authid(tid,authid,34)
  256. if(containi(authid,"ID_LAN") != -1)
  257. get_user_ip(tid,authid,34,1)
  258. #if SQLON
  259. result = dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
  260. if(result >= RESULT_OK)
  261. {
  262. dbi_free_result(result)
  263. result = dbi_query(dbc,"UPDATE amxwarn SET warnlevel = '%d' WHERE authid = '%s'",swarnlevel[tid],authid)
  264. }
  265. else
  266. {
  267. dbi_free_result(result)
  268. result = dbi_query(dbc,"INSERT INTO amxwarn VALUES ( '%s' , '%d' )",authid,swarnlevel[tid])
  269. }
  270. dbi_free_result(result)
  271. #else
  272. new retstr[51], inum, a, bool:there = false, firstempty = -1
  273. while(read_file(filepath,inum,retstr,50,a) != 0)
  274. {
  275. if(strlen(retstr) <= 0) firstempty = inum
  276. new fid[35], warnlevel[2]
  277. parse(retstr,fid,34,warnlevel,1)
  278. new warnnum = str_to_num(warnlevel)
  279. if(equali(fid,authid))
  280. {
  281. there = true
  282. warnnum++
  283. new newwarn[2]
  284. num_to_str(warnnum,newwarn,1)
  285. replace(retstr,50,warnlevel,newwarn)
  286. write_file(filepath,retstr,inum)
  287. }
  288. inum++
  289. }
  290. if(!there)
  291. {
  292. new writestr[51]
  293. format(writestr,50,"%s %d",authid,swarnlevel[tid])
  294. write_file(filepath,writestr,firstempty)
  295. }
  296. #endif
  297. return PLUGIN_HANDLED
  298. }
  299.  
  300. public unswarn(id,level,cid)
  301. {
  302. if(!cmd_access(id,level,cid,2))
  303. return PLUGIN_HANDLED
  304. new target[32],tid,name[32]
  305. read_args(target,31)
  306. tid = cmd_target(id,target,2)
  307. if(!tid)
  308. return PLUGIN_HANDLED
  309. get_user_name(tid,name,31)
  310. if(swarnlevel[tid] == 0)
  311. console_print(id,"%s has not been warned.",name)
  312. else
  313. {
  314. swarnlevel[tid] = 0
  315. console_print(id,"%s's warnings have been removed.",name)
  316. client_print(tid,print_chat,"Your warnings have been removed.")
  317. new authid[35]
  318. get_user_authid(tid,authid,34)
  319. if(containi(authid,"ID_LAN") != -1)
  320. get_user_ip(tid,authid,34,1)
  321. #if SQLON
  322. result = dbi_query(dbc,"DELETE FROM amxwarn WHERE authid = '%s'",authid)
  323. #else
  324. new retstr[51], inum, a
  325. while(read_file(filepath,inum,retstr,50,a) != 0)
  326. {
  327. new fid[35], warny[2]
  328. parse(retstr,fid,34,warny,1)
  329. if(equali(authid,fid))
  330. {
  331. new writestr[51]
  332. format(writestr,50,"^r")
  333. write_file(filepath,writestr,inum)
  334. }
  335. inum++
  336. }
  337. #endif
  338. }
  339. return PLUGIN_HANDLED
  340. }
  341.  
  342. public flash(id)
  343. {
  344. if(get_cvar_num("amx_warn_flash") >= 1)
  345. {
  346. g_MsgScreenFade = get_user_msgid("ScreenFade")
  347. message_begin(MSG_ONE,g_MsgScreenFade,{0,0,0},id)
  348. write_short(1<<14)
  349. write_short(1<<9)
  350. write_short(1<<11)
  351. if(get_cvar_num("amx_warn_flash"))
  352. {
  353. write_byte( 255 )
  354. write_byte( 0 )
  355. write_byte( 0 )
  356. write_byte( 255 )
  357. }
  358. else if(get_cvar_num("amx_warn_flash") == 2)
  359. {
  360. write_byte( 255 )
  361. write_byte( 255 )
  362. write_byte( 255 )
  363. write_byte( 255 )
  364. }
  365. else if(get_cvar_num("amx_warn_flash") == 3)
  366. {
  367. new red,green,blue
  368. red = random_num(0,255)
  369. green = random_num(0,255)
  370. blue = random_num(0,255)
  371. write_byte(red)
  372. write_byte(green)
  373. write_byte(blue)
  374. write_byte(255)
  375. }
  376. message_end()
  377. }
  378. }
  379.  
  380. public client_putinserver(id)
  381. {
  382. playerwarnings[id] = 0
  383. swarnlevel[id] = 0
  384. new authid[35]
  385. get_user_authid(id,authid,34)
  386. if(containi(authid,"ID_LAN") != -1)
  387. get_user_ip(id,authid,34,1)
  388. #if SQLON
  389. result = dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
  390. if(result >= RESULT_OK)
  391. {
  392. dbi_nextrow(result)
  393. swarnlevel[id] = dbi_result(result,"warnlevel")
  394. }
  395. dbi_free_result(result)
  396. #else
  397. new retstr[51], inum, a
  398. while(read_file(filepath,inum,retstr,50,a) != 0)
  399. {
  400. new fid[35], warnlevel[2]
  401. parse(retstr,fid,34,warnlevel,1)
  402. if(equali(fid,authid))
  403. swarnlevel[id] = str_to_num(warnlevel)
  404. inum++
  405. }
  406. #endif
  407. if(swarnlevel[id] > 0)
  408. client_print(id,print_center,"You have been warned %d times during your visits to this server.",swarnlevel)
  409. }
  410.  
  411. public client_disconnect(id)
  412. {
  413. playerwarnings[id] = 0
  414. swarnlevel[id] = 0
  415. }
  416.  
  417. public playerwarn(id)
  418. {
  419. if(get_cvar_num("amx_playerwarn_allow") == 1)
  420. {
  421. new target[32],tid,name[32],Float:perc,Float:make,suid
  422. read_args(target,31)
  423. tid = cmd_target(id,target,1)
  424. if(!tid)
  425. return PLUGIN_HANDLED
  426. if(warned[id][tid] == 1)
  427. {
  428. console_print(id,"You can only add your warn vote to up someone's warning level once per warning level.")
  429. return PLUGIN_HANDLED
  430. }
  431. playerwarnings[tid]++
  432. perc = floatdiv(float(playerwarnings[tid]),float(get_playersnum()))
  433. make = get_cvar_float("amx_playerwarn_ratio")
  434. get_user_name(tid,name,31)
  435. suid = get_user_userid(tid)
  436. client_print(0,print_chat,"%s's vote warn level has increased. If %s's warning level should be increased use: warn %s.",name,name,name)
  437. warned[id][tid] = 1
  438. if(floatcmp(perc,make) == 1)
  439. {
  440. client_print(0,print_chat,"%s's warning level has been increased.",name)
  441. for(new i=1;i<=get_playersnum();i++)
  442. {
  443. warned[i][tid] = 0
  444. client_print(i,print_chat,"You can attempt to up %s's warning level again.",name)
  445. }
  446. playerwarnings[tid] = 0
  447. switch(swarnlevel[tid])
  448. {
  449. case 1:
  450. {
  451. new punishment
  452. punishment = get_cvar_num("amx_warn_lvl1")
  453. switch(punishment)
  454. {
  455. case 0:
  456. client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
  457. case 1:
  458. {
  459. new slapdmg = get_cvar_num("amx_slap_lvl1dmg")
  460. user_slap(tid,slapdmg)
  461. client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
  462. }
  463. case 2:
  464. {
  465. user_kill(tid)
  466. client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
  467. }
  468. case 3:
  469. server_cmd("kick #%d",suid)
  470. case 4:
  471. {
  472. new banlength
  473. banlength = get_cvar_num("amx_tempban_lvl1time")
  474. server_cmd("banid %d #%d kick",banlength,suid)
  475. }
  476. case 5:
  477. server_cmd("banid 0 #%d kick",suid)
  478. }
  479. }
  480. case 2:
  481. {
  482. new punishment
  483. punishment = get_cvar_num("amx_warn_lvl2")
  484. switch(punishment)
  485. {
  486. case 0:
  487. client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
  488. case 1:
  489. {
  490. new slapdmg = get_cvar_num("amx_slap_lvl2dmg")
  491. user_slap(tid,slapdmg)
  492. client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
  493. }
  494. case 2:
  495. {
  496. user_kill(tid)
  497. client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
  498. }
  499. case 3:
  500. server_cmd("kick #%d",suid)
  501. case 4:
  502. {
  503. new banlength
  504. banlength = get_cvar_num("amx_tempban_lvl2time")
  505. server_cmd("banid %d #%d kick",banlength,suid)
  506. }
  507. case 5:
  508. server_cmd("banid 0 #%d kick",suid)
  509. }
  510. }
  511. case 3:
  512. {
  513. new punishment
  514. punishment = get_cvar_num("amx_warn_lvl3")
  515. switch(punishment)
  516. {
  517. case 0:
  518. client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
  519. case 1:
  520. {
  521. new slapdmg = get_cvar_num("amx_slap_lvl3dmg")
  522. user_slap(tid,slapdmg)
  523. client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
  524. }
  525. case 2:
  526. {
  527. user_kill(tid)
  528. client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
  529. }
  530. case 3:
  531. server_cmd("kick #%d",suid)
  532. case 4:
  533. {
  534. new banlength
  535. banlength = get_cvar_num("amx_tempban_lvl3time")
  536. server_cmd("banid %d #%d kick",banlength,suid)
  537. }
  538. case 5:
  539. server_cmd("banid 0 #%d kick",suid)
  540. }
  541. }
  542. case 4:
  543. {
  544. new punishment
  545. punishment = get_cvar_num("amx_warn_lvl4")
  546. switch(punishment)
  547. {
  548. case 0:
  549. client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
  550. case 1:
  551. {
  552. new slapdmg = get_cvar_num("amx_slap_lvl4dmg")
  553. user_slap(tid,slapdmg)
  554. client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
  555. }
  556. case 2:
  557. {
  558. user_kill(tid)
  559. client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
  560. }
  561. case 3:
  562. server_cmd("kick #%d",suid)
  563. case 4:
  564. {
  565. new banlength
  566. banlength = get_cvar_num("amx_tempban_lvl4time")
  567. server_cmd("banid %d #%d kick",banlength,suid)
  568. }
  569. case 5:
  570. server_cmd("banid 0 #%d kick",suid)
  571. }
  572. }
  573. default:
  574. {
  575. new punishment
  576. punishment = get_cvar_num("amx_warn_lvl5")
  577. switch(punishment)
  578. {
  579. case 0:
  580. client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
  581. case 1:
  582. {
  583. new slapdmg = get_cvar_num("amx_slap_lvl5dmg")
  584. user_slap(tid,slapdmg)
  585. client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
  586. }
  587. case 2:
  588. {
  589. user_kill(tid)
  590. client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
  591. }
  592. case 3:
  593. server_cmd("kick #%d",suid)
  594. case 4:
  595. {
  596. new banlength
  597. banlength = get_cvar_num("amx_tempban_lvl5time")
  598. server_cmd("banid %d #%d kick",banlength,suid)
  599. }
  600. case 5:
  601. server_cmd("banid 0 #%d kick",suid)
  602. }
  603. }
  604. }
  605. new authid[35]
  606. get_user_authid(tid,authid,34)
  607. if(containi(authid,"ID_LAN") != -1)
  608. get_user_ip(tid,authid,34,1)
  609. #if SQLON
  610. result = dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
  611. if(result >= RESULT_OK)
  612. {
  613. dbi_free_result(result)
  614. result = dbi_query(dbc,"UPDATE amxwarn SET warnlevel = '%d' WHERE authid = '%s'",swarnlevel[tid],authid)
  615. }
  616. else
  617. {
  618. dbi_free_result(result)
  619. result = dbi_query(dbc,"INSERT INTO amxwarn VALUES ( '%s' , '%d' )",authid,swarnlevel[tid])
  620. }
  621. dbi_free_result(result)
  622. #else
  623. new retstr[51], inum, a, bool:there = false, firstempty = -1
  624. while(read_file(filepath,inum,retstr,50,a) != 0)
  625. {
  626. if(strlen(retstr) <= 0) firstempty = inum
  627. new fid[35], warnlevel[2]
  628. parse(retstr,fid,34,warnlevel,1)
  629. new warnnum = str_to_num(warnlevel)
  630. if(equali(fid,authid))
  631. {
  632. there = true
  633. warnnum++
  634. new newwarn[2]
  635. num_to_str(warnnum,newwarn,1)
  636. replace(retstr,50,warnlevel,newwarn)
  637. write_file(filepath,retstr,inum)
  638. }
  639. inum++
  640. }
  641. if(!there)
  642. {
  643. new writestr[51]
  644. format(writestr,50,"%s %d",authid,swarnlevel[tid])
  645. write_file(filepath,writestr,firstempty)
  646. }
  647. #endif
  648. }
  649. else
  650. {
  651. new playersneeded
  652. new Float:halfplayers
  653. halfplayers = (get_playersnum() * make)
  654. new hplayers = floatround(halfplayers,floatround_ceil)
  655. playersneeded = (hplayers - playerwarnings[tid])
  656. console_print(id,"%d more players need to warn %s to increase %s's warning level.",playersneeded,name,name)
  657. }
  658. }
  659. else
  660. {
  661. console_print(id,"Player warns have been disabled.")
  662. }
  663. return PLUGIN_HANDLED
  664. }

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: slay_kase | amx_warn
HozzászólásElküldve:2012.09.09. 17:53 
Offline
Őskövület
Avatar

Csatlakozott:2011.09.17. 17:54
Hozzászólások:2350
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 57 alkalommal
Slay kase: Cod mod féleség
Warn: Kiír üzeneteket az illetőnek akit ütsz,bannolsz stb...


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: slay_kase | amx_warn
HozzászólásElküldve:2012.09.09. 19:39 
Offline
Őskövület
Avatar

Csatlakozott:2011.12.28. 00:35
Hozzászólások:2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Köszi :D

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 32 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole