hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 20:09



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-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: Színes kés párbaj
HozzászólásElküldve: 2014.10.24. 22:21 
Offline
Beavatott

Csatlakozott: 2014.09.02. 09:02
Hozzászólások: 95
Megköszönt másnak: 4 alkalommal
Megköszönték neki: 1 alkalommal
Sziasztok,nekem egy olyan kés párbaj plugin kéne ami színesítve van
Aki megcsinálja megy a GOMD


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színes kés párbaj
HozzászólásElküldve: 2014.10.24. 22:38 
Pontosan mien szinre?


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színes kés párbaj
HozzászólásElküldve: 2014.10.24. 22:44 
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
spacewoodoo16 írta:
Sziasztok,nekem egy olyan kés párbaj plugin kéne ami színesítve van
Aki megcsinálja megy a GOMD


Try:
SMA Forráskód: [ Mindet kijelol ]
  1. #define PLUGINNAME "Automatic knife duel"
  2. #define VERSION "0.3"
  3. #define AUTHOR "JGHG"
  4. /*
  5. Copyleft 2005
  6.  
  7.  
  8. AUTOMATIC KNIFE DUEL
  9. ====================
  10. Where I come from, if you cut the wall repeteadly with your knife it means you're challenging your last opponent to a knife duel. <!-- s;-) --><img src=\"{SMILIES_PATH}/icon_e_wink.gif\" alt=\";-)\" title=\"kacsintás\" /><!-- s;-) -->
  11.  
  12. I decided to automate this process.
  13.  
  14. If only you and another person on the opposite team remain in the round, you can hit a wall (or another object) with your knife, THREE TIMES in fast succession.
  15. By this action you challenge your opponent to a knife duel. The person you challenge gets a menu where he can accept/decline your
  16. challenge. The challenged person has 10 seconds to decide his mind, else the challenge is automatically declined, and the menu should be closed automatically.
  17.  
  18. Should a knife duel start, it works out pretty much like a round of Knife Arena: you can only use the knife (and the C4!).
  19. As soon as the round ends the Knife Arena mode is turned off.
  20.  
  21. /JGHG
  22.  
  23.  
  24. VERSIONS
  25. ========
  26. 050421 0.3 You must now slash with your knife three times in fast succession to challenge someone.
  27. 050208 0.2 Fixed seconds display.
  28. Bots should now respond correctly and a little human like. They will mostly accept challenges. <!-- s;-) --><img src=\"{SMILIES_PATH}/icon_e_wink.gif\" alt=\";-)\" title=\"kacsintás\" /><!-- s;-) -->
  29. Small fixes here and there. <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":-)\" title=\"mosoly\" /><!-- s:-) -->
  30. 050208 0.1 First version - largely untested
  31. */
  32.  
  33. #include <amxmodx>
  34. #include <fakemeta>
  35. #include <fun>
  36.  
  37. #define DEBUG
  38.  
  39. #if defined DEBUG
  40. #include <amxmisc>
  41. #endif // defined DEBUG
  42.  
  43. #define MENUSELECT1 0
  44. #define MENUSELECT2 1
  45. #define TASKID_CHALLENGING 2348923
  46. #define TASKID_BOTTHINK 3242321
  47. #define DECIDESECONDS 20
  48. #define ALLOWED_WEAPONS 2
  49. #define KNIFESLASHES 3 // the nr of slashes within a short amount of time until a challenge starts...
  50. // Globals below
  51. new g_allowedWeapons[ALLOWED_WEAPONS] = {CSW_KNIFE, CSW_C4}
  52. new g_MAXPLAYERS
  53. new bool:g_challenging = false
  54. new bool:g_knifeArena = false
  55. new bool:g_noChallengingForAWhile = false
  56. new g_challengemenu
  57. new g_challenger
  58. new g_challenged
  59. new g_challenges[33]
  60. // Globals above
  61.  
  62. public plugin_modules()
  63. {
  64. require_module("fakemeta")
  65. require_module("fun")
  66. }
  67.  
  68. public forward_emitsound(const PIRATE, const Onceuponatimetherewasaverysmall, noise[], const Float:turtlewhoateabiggerturtleand, const Float:afterthatthesmallturtlegot, const veryveryverybig, const theend) {
  69. if (g_noChallengingForAWhile || g_knifeArena || g_challenging || PIRATE < 1 || PIRATE > g_MAXPLAYERS || !is_user_alive(PIRATE) || !equal(noise, "weapons/knife_hitwall1.wav"))
  70. return FMRES_IGNORED
  71.  
  72. new team = get_user_team(PIRATE), otherteam = 0, matchingOpponent = 0
  73. // Make sure exactly one person on each team is alive.
  74. for (new i = 1; i <= g_MAXPLAYERS; i++) {
  75. if (!is_user_connected(i) || !is_user_alive(i) || PIRATE == i)
  76. continue
  77. if (get_user_team(i) == team) {
  78. // No fun.
  79. return FMRES_IGNORED
  80. }
  81. else {
  82. if (++otherteam > 1) {
  83. // No fun.
  84. return FMRES_IGNORED
  85. }
  86. matchingOpponent = i
  87. }
  88. }
  89.  
  90. if (matchingOpponent == 0)
  91. return FMRES_IGNORED
  92.  
  93. if (++g_challenges[PIRATE] >= KNIFESLASHES) {
  94. Challenge(PIRATE, matchingOpponent)
  95. if (is_user_bot(matchingOpponent)) {
  96. new Float:val = float(DECIDESECONDS)
  97. if (val < 2.0)
  98. val = 2.0
  99. remove_task(TASKID_BOTTHINK)
  100. set_task(random_float(1.0, float(DECIDESECONDS) - 1.0), "BotDecides", TASKID_BOTTHINK)
  101. }
  102. g_challenges[PIRATE] = 0
  103. }
  104. else
  105. set_task(1.0, "decreaseChallenges", PIRATE)
  106.  
  107. //client_print(PIRATE, print_chat, "Your challenges: %d", g_challenges[PIRATE])
  108.  
  109. return FMRES_IGNORED
  110. }
  111.  
  112. public decreaseChallenges(id) {
  113. if (--g_challenges[id] < 0)
  114. g_challenges[id] = 0
  115. }
  116.  
  117. public BotDecides() {
  118. if (!g_challenging)
  119. return
  120.  
  121. if (random_num(0,9) > 0)
  122. Accept()
  123. else {
  124. DeclineMsg()
  125. }
  126. g_challenging = false
  127. remove_task(TASKID_CHALLENGING)
  128. }
  129.  
  130. Challenge(challenger, challenged) {
  131. g_challenger = challenger
  132. g_challenged = challenged
  133. g_challenging = true
  134. new challenger_name[32], challenged_name[32]
  135. get_user_name(challenger, challenger_name, 31)
  136. get_user_name(challenged, challenged_name, 31)
  137.  
  138. print_color(challenger, "!yMegakarsz küzdeni!t %s!y -val egy késpárbajban? Várj a válaszára!t %d!y másodpercet!g...", challenged_name, DECIDESECONDS)
  139.  
  140. new menu[1024], keys = MENU_KEY_1 | MENU_KEY_2
  141. format(menu, 1023, "Megakarsz kuzdeni %s egy kesparbajban?^n^nMit teszel? Van %d masodmeprced a valaszra!^n^n\y1\w. Vagjunk bele!^n\y2\w. Nem merek mert gyava kukac vagyok!", challenger_name, DECIDESECONDS)
  142. show_menu(challenged, keys, menu, DECIDESECONDS, "JGHG's automatic knife duel")
  143. set_task(float(DECIDESECONDS), "timed_toolate", TASKID_CHALLENGING)
  144. }
  145.  
  146. public timed_toolate() {
  147. if (g_challenging) {
  148. new challenger_name[32], challenged_name[32]
  149. get_user_name(g_challenger, challenger_name, 31)
  150. get_user_name(g_challenged, challenged_name, 31)
  151. print_color(0, "!t%s!y Nem válaszolt!t %s!y a kihívására elég gyorsan!g...", challenged_name, challenger_name)
  152. CancelAll()
  153. }
  154. }
  155.  
  156. public client_putinserver(id) {
  157. set_task(25.0, "Announcement", id)
  158.  
  159. return PLUGIN_CONTINUE
  160. }
  161.  
  162. public Announcement(id) {
  163. print_color(id, "!yAmikor már csak!t te és egy ellenséged maradt!y ki tudod hívni őt egy késpárbajra, csak verd a késed a falhoz!")
  164. }
  165.  
  166. public challenged_menu(id, key) {
  167. switch (key) {
  168. case MENUSELECT1: {
  169. // Accept
  170. Accept()
  171. }
  172. case MENUSELECT2: {
  173. // Decline
  174. DeclineMsg()
  175. }
  176. }
  177. g_challenging = false
  178. remove_task(TASKID_CHALLENGING)
  179.  
  180. return PLUGIN_HANDLED
  181. }
  182.  
  183. DeclineMsg() {
  184. new challenger_name[32], challenged_name[32]
  185. get_user_name(g_challenger, challenger_name, 31)
  186. get_user_name(g_challenged, challenged_name, 31)
  187. print_color(0, "!t%s!y Nem fogadta el!t %s!y kihívását!g...", challenged_name, challenger_name)
  188. }
  189.  
  190. Accept() {
  191. new challenger_name[32], challenged_name[32]
  192. get_user_name(g_challenger, challenger_name, 31)
  193. get_user_name(g_challenged, challenged_name, 31)
  194.  
  195. print_color(0, "!t%s!y Elfogadta!t %s!y kihívását!", challenged_name, challenger_name)
  196. g_knifeArena = true
  197. give_item(g_challenger, "weapon_knife")
  198. give_item(g_challenged, "weapon_knife")
  199. engclient_cmd(g_challenger, "weapon_knife")
  200. engclient_cmd(g_challenged, "weapon_knife")
  201. }
  202.  
  203. public event_holdwpn(id) {
  204. if (!g_knifeArena || !is_user_alive(id))
  205. return PLUGIN_CONTINUE
  206.  
  207. new weaponType = read_data(2)
  208.  
  209. for (new i = 0; i < ALLOWED_WEAPONS; i++) {
  210. if (weaponType == g_allowedWeapons[i])
  211. return PLUGIN_CONTINUE
  212. }
  213.  
  214. engclient_cmd(id, "weapon_knife")
  215.  
  216. return PLUGIN_CONTINUE
  217. }
  218.  
  219. public event_roundend() {
  220. if (g_challenging || g_knifeArena)
  221. CancelAll()
  222. g_noChallengingForAWhile = true
  223. set_task(4.0, "NoChallengingForAWhileToFalse")
  224.  
  225. return PLUGIN_CONTINUE
  226. }
  227.  
  228. public NoChallengingForAWhileToFalse() {
  229. g_noChallengingForAWhile = false
  230. }
  231.  
  232. CancelAll() {
  233. if (g_challenging) {
  234. g_challenging = false
  235. // Close menu of challenged
  236. if (is_user_connected(g_challenged)) {
  237. new usermenu, userkeys
  238. get_user_menu(g_challenged, usermenu, userkeys) // get user menu
  239.  
  240. // Hmm this ain't working :-/
  241. if (usermenu == g_challengemenu) // Close it!
  242. show_menu(g_challenged, 0, "blabla") // show empty menu
  243. }
  244. }
  245. if (g_knifeArena) {
  246. g_knifeArena = false
  247. }
  248. remove_task(TASKID_BOTTHINK)
  249. remove_task(TASKID_CHALLENGING)
  250. }
  251.  
  252. public event_death() {
  253. if (g_challenging || g_knifeArena)
  254. CancelAll()
  255.  
  256. return PLUGIN_CONTINUE
  257. }
  258.  
  259. #if defined DEBUG
  260. public challengefn(id, level, cid) {
  261. if (!cmd_access(id, level, cid, 3))
  262. return PLUGIN_HANDLED
  263.  
  264. new challenger[64], challenged[64]
  265. read_argv(1, challenger, 63)
  266. read_argv(2, challenged, 63)
  267.  
  268. console_print(id, "challenger: %s, challenged: %s", challenger, challenged)
  269.  
  270. new r = str_to_num(challenger)
  271. new d = str_to_num(challenged)
  272. Challenge(r, d)
  273. if (is_user_bot(d))
  274. Accept()
  275.  
  276. return PLUGIN_HANDLED
  277. }
  278. #endif // defined DEBUG
  279.  
  280. public plugin_init() {
  281. register_plugin(PLUGINNAME, VERSION, AUTHOR)
  282. register_event("CurWeapon", "event_holdwpn", "be", "1=1")
  283. register_forward(FM_EmitSound, "forward_emitsound")
  284. g_MAXPLAYERS = get_maxplayers()
  285.  
  286. g_challengemenu = register_menuid("JGHG's automatic knife duel"/*"You are challenged"*/)
  287. register_menucmd(g_challengemenu, MENU_KEY_1 | MENU_KEY_2, "challenged_menu")
  288.  
  289. register_event("DeathMsg", "event_death", "a")
  290. register_event("SendAudio", "event_roundend", "a", "2&%!MRAD_terwin")
  291. register_event("SendAudio", "event_roundend", "a", "2&%!MRAD_ctwin")
  292. register_event("SendAudio", "event_roundend", "a", "2&%!MRAD_rounddraw")
  293.  
  294. #if defined DEBUG
  295. register_clcmd("0challenge", "challengefn", ADMIN_CFG, "<challenger> <challenged> - start knife duel challenge")
  296. #endif // defined DEBUG
  297.  
  298. new Float:maptime = get_cvar_float("mp_timelimit")
  299. if (maptime == 0.0)
  300. maptime = 15.0
  301.  
  302. new Float:anntime = 60.0 * 5.0 // 5 minutes
  303. if (maptime < 5.0)
  304. anntime = maptime / 3.0
  305.  
  306. set_task(anntime, "Announcement", 0, "", 0, "b")
  307. }
  308.  
  309. stock print_color(const id, const input[], any:...)
  310. {
  311. new count = 1, players[32]
  312. static msg[191]
  313. vformat(msg, 190, input, 3)
  314.  
  315. replace_all(msg, 190, "!g", "^4")
  316. replace_all(msg, 190, "!y", "^1")
  317. replace_all(msg, 190, "!t", "^3")
  318. replace_all(msg, 190, "á", "á")
  319. replace_all(msg, 190, "é", "Ă©")
  320. replace_all(msg, 190, "í", "Ă­")
  321. replace_all(msg, 190, "ó", "Ăł")
  322. replace_all(msg, 190, "ö", "ö")
  323. replace_all(msg, 190, "ő", "Ĺ‘")
  324. replace_all(msg, 190, "ú", "Ăş")
  325. replace_all(msg, 190, "ü", "ĂĽ")
  326. replace_all(msg, 190, "ű", "ű")
  327. replace_all(msg, 190, "Á", "Á")
  328. replace_all(msg, 190, "É", "É")
  329. replace_all(msg, 190, "Í", "ĂŤ")
  330. replace_all(msg, 190, "Ó", "Ă“")
  331. replace_all(msg, 190, "Ö", "Ă–")
  332. replace_all(msg, 190, "Ő", "Ő")
  333. replace_all(msg, 190, "Ú", "Ăš")
  334. replace_all(msg, 190, "Ü", "Ăś")
  335. replace_all(msg, 190, "Ű", "Ĺ°")
  336.  
  337. if (id) players[0] = id; else get_players(players, count, "ch")
  338. {
  339. for (new i = 0; i < count; i++)
  340. {
  341. if (is_user_connected(players[i]))
  342. {
  343. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  344. write_byte(players[i])
  345. write_string(msg)
  346. message_end()
  347. }
  348. }
  349. }
  350. return PLUGIN_HANDLED
  351. }


UI:
!y = Sárga. Alap szín
!t = Kék, piros. Csapat szín
!g = Zöld

_________________
****

Ők köszönték meg pixxa112 nek ezt a hozzászólást: Beckx (2014.11.26. 17:32)
  Népszerűség: 2.27%


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 7 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