Raised This Month: $ Target: $400
 0% 

Hero: Highlander


Post New Thread Reply   
 
Thread Tools Display Modes
kennyke12
Junior Member
Join Date: Mar 2011
Location: Hungary
Old 03-21-2011 , 09:40   Re: Hero: Highlander
Reply With Quote #11

Update: He will respawn until he get a headshot.
P.s: Sorry for my grammar, english isn't my main language
I'll make it better but it's good for a while.
kennyke12 is offline
Send a message via MSN to kennyke12
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-21-2011 , 09:50   Re: Hero: Highlander
Reply With Quote #12

Looking at the script Im not entirely sure of what you want to achieve here, but wouldnt it be better to just check if headshot is true in client_damage instead? Thus blocking all other bodyparts entirely, so you can only damage enemies with this hero with headshots. Perhaps what you want is to be able to damage them but to entirely kill them you have to score a headshot, but that sounds stupid lol. Lots of entirely's in there..
__________________
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-21-2011 , 09:56   Re: Hero: Highlander
Reply With Quote #13

PHP Code:
    if ( !is_user_alive(id))
    {
        new 
parm[1]
        
parm[0] = id
        
        set_task
(0.5"highlander_respawn"0parm1)
    } 
What... Just... What????

What you are doing there is just totally unnecessary.

Also, what happens in your code is that it will probably crash the server. Have you even tested what you are actually posting?
When a player is killed by a non-headshot the attacker still gets the XP for that kill.
Also, I think you are respawning too soon. I believe you have to wait for about 2 seconds to be on the safe side.
Also, use ham to spawn with. That is much better.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-21-2011 , 10:01   Re: Hero: Highlander
Reply With Quote #14

Yeah I didnt see that LOL

Use

[pawn]ExecuteHamB(Ham_CS_RoundRespawn, id)[pawn] instead if "id" is your index, which it is.

I fail.
__________________

Last edited by The Art of War; 03-21-2011 at 10:53.
The Art of War is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 03-21-2011 , 11:45   Re: Hero: Highlander
Reply With Quote #15

client_damage forward is called after players attack.

Here is certainly the best way to do it.
Attached Files
File Type: sma Get Plugin or Get Source (sh_highlander.sma - 482 views - 1.5 KB)

Last edited by Fr33m@n; 03-21-2011 at 12:46.
Fr33m@n is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 03-22-2011 , 11:45   Re: Hero: Highlander
Reply With Quote #16

Quote:
Originally Posted by Fr33m@n View Post
client_damage forward is called after players attack.

Here is certainly the best way to do it.
I believe he would appreciate some explanation of what you did there, and I would certainly not complain about it either.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-22-2011 , 12:45   Re: Hero: Highlander
Reply With Quote #17

Quote:
Originally Posted by Exploited View Post
I believe he would appreciate some explanation of what you did there, and I would certainly not complain about it either.

What part lol?

This is the ham hook:

Code:
RegisterHam(Ham_TraceAttack, "player", "Ham_Player_TraceAttack_Pre", false)

False as param 4 means its Pre, not post (hence "Pre" in the forward name).

Code:
public Ham_Player_TraceAttack_Pre(victim, attacker, Float:flDamage, Float:fDir[3], ptr, DamageType)
victim, attacker, damage (why is this here?), wtf?!, ptr, typ of damage.


Code:
if ( gHasHighlander[victim] && DamageType & DMG_BULLET && is_user_alive(attacker) )

-->

If user has the hero, if damage type is DMG_BULLET ie weapon fired is not knife, HE, flash or smoke-grenades; is the attacker is alive.

Code:
if( get_tr2(ptr, TR_iHitgroup) != HIT_HEAD )
-->

If the hitgroup of ptr is NOT head ie a headshot

Code:
set_tr2(ptr, TR_iHitgroup, HIT_GENERIC)
Set ptr's hitgroup to generic.

Hmm, Im sure I got something wrong. Someone please correct me, Im not using ham hooks often at all.

EDIT: A tip if you want to figure some stuff out yourself this is a good website:

http://www.amxmodx.org/funcwiki.php
__________________

Last edited by The Art of War; 03-22-2011 at 12:53.
The Art of War is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 03-22-2011 , 16:10   Re: Hero: Highlander
Reply With Quote #18

http://forums.alliedmods.net/showpos...3&postcount=42

Last edited by Fr33m@n; 03-22-2011 at 16:13.
Fr33m@n is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode