March 19, 2019, 07:56:32 AM

Author Topic: only headshot  (Read 2203 times)

Baster

  • Guest
only headshot
« on: May 29, 2011, 07:55:58 PM »
Hi i hope someone can help me

I looking for a only headshot skill

http://www.warcraft-source.com/board/index.php?topic=1374.0

I work on a race like the race in this topic


Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1856
  • Country: be
    • Fortitude
Re: only headshot
« Reply #1 on: May 29, 2011, 07:59:45 PM »
well this still works:

Code: [Select]
cmd = "if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then wcs_setfx health event_var(userid) + event_var(dmg_health);if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then es_xtell event_var(attacker) #green To kill a zombie aim for the head;es_tell event_var(userid) #green They are shooting you"
If you don't want the knife to be there, you might wna consider removing it or something :p

Edit2: sry its es_tell for the last one as its not expanded (while "if ... then" does expand the first one). There you go :)
« Last Edit: May 29, 2011, 08:22:06 PM by La Muerte »
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??

Baster

  • Guest
Re: only headshot
« Reply #2 on: May 29, 2011, 08:23:57 PM »
   [[skill3]]
      setting = "es_xrand wcs_rand 1 8|es_xrand wcs_rand 1 7|es_xrand wcs_rand 1 6|es_xrand wcs_rand 1 5|es_xrand wcs_rand 1 4|es_xrand wcs_rand 1 3|es_xrand wcs_rand 1 2|es_xrand wcs_rand 1 1"
      cmd = "cmd = "if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then wcs_setfx health event_var(userid) + event_var(dmg_health);if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then es_tell event_var(attacker) #green To kill a zombie aim for the head;es_tell event_var(userid) #green They are shooting you""
      sfx = "
      cooldown = "0"



And this works ? thank you ^^ i try it on my testserver ^^

Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1856
  • Country: be
    • Fortitude
Re: only headshot
« Reply #3 on: May 29, 2011, 08:34:48 PM »
you might check your syntax again, your quotes are all messed up lol
at cmd and at sfx
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??

Baster

  • Guest
Re: only headshot
« Reply #4 on: May 29, 2011, 08:42:59 PM »
i know copy past fail ^^

Code: [Select]
[[skill1]]
      setting = "es_xrand wcs_rand 1 1"
cmd = "if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then wcs_setfx health event_var(userid) + event_var(dmg_health);if (event_var(weapon) != knife) then es_xif (event_var(hitgroup) != 1) then es_xtell event_var(attacker) #green To kill a zombie aim for the head;es_tell event_var(userid) #green They are shooting you"
      sfx = ""
« Last Edit: May 29, 2011, 08:44:03 PM by La Muerte »

Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1856
  • Country: be
    • Fortitude
Re: only headshot
« Reply #5 on: May 29, 2011, 08:44:35 PM »
first tell had to be es_xtell due to "if ... then" expanding it :).
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??

Baster

  • Guest
Re: only headshot
« Reply #6 on: May 29, 2011, 09:20:33 PM »
ok but i have another problem dmg can kill the race without a headshot

Muse

  • Guest
Re: only headshot
« Reply #7 on: May 30, 2011, 05:25:40 AM »
oO RLY?
omg shot is faster than console command.

Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1856
  • Country: be
    • Fortitude
Re: only headshot
« Reply #8 on: May 30, 2011, 10:20:48 AM »
Theres been another topic in which Muse and myself tried to explain how you can prevent this by using SPE or SM.
Either way you need to hook the moment of getting hit, which can happen both with SPE and/or SM.
With only EventScripts its just executing after you've been hit. With hooking its executed instantly on hit to prevent the damage from happening.
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??