Raised This Month: $ Target: $400
 0% 

[CSS] One hit kill with knife


Post New Thread Reply   
 
Thread Tools Display Modes
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 09-15-2012 , 13:16   Re: [CSS] One hit kill with knife
Reply With Quote #11

Quote:
Originally Posted by shavit View Post
Why "Aw..."?
You beat me to it. (Thought I would probably kept being lazy and take too much time to make it).
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-15-2012 , 13:42   Re: [CSS] One hit kill with knife
Reply With Quote #12

Quote:
Originally Posted by RedSword View Post
You beat me to it. (Thought I would probably kept being lazy and take too much time to make it).
technically its made in bones.... lol just bones is a full mod
Doc-Holiday is offline
mikehawk1339
Member
Join Date: May 2011
Old 09-15-2012 , 13:48   Re: [CSS] One hit kill with knife
Reply With Quote #13

Quote:
Originally Posted by RedSword View Post
Player hurt is just an event. An event is just a notification. Most of the time you can't really modify the real "event". SDKHooks "hooks" the attack, meaning you have a way bigger control over it, not just a "moment when it occured with some infos".



Aw... =/
Oh I see. I'm trying to convert all my Eventscript plugins to SM and I used player_hurt in ES. Probably because stuff like SDKHooks don't exist in ES. That's why I used player_hurt. Additionally I checked if the player was damaged by a hand grenade, if so, they would be burned. And lastly I would play a custom player hurt sound whenever a player was hurt. Should all of these be put under OnTakeDamage?
mikehawk1339 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-15-2012 , 14:58  
Reply With Quote #14

Quote:
Originally Posted by mikehawk1339 View Post
Oh I see. I'm trying to convert all my Eventscript plugins to SM and I used player_hurt in ES. Probably because stuff like SDKHooks don't exist in ES. That's why I used player_hurt. Additionally I checked if the player was damaged by a hand grenade, if so, they would be burned. And lastly I would play a custom player hurt sound whenever a player was hurt. Should all of these be put under OnTakeDamage?
On take damge is to modify the stuff... The event notification - play_hurt - can be used for the rest of the stuff. If your using the hook already just place them there. If your not modifying the info then the even works fine.
Doc-Holiday is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 09-15-2012 , 15:54   Re: [CSS] One hit kill with knife
Reply With Quote #15

Quote:
Originally Posted by mikehawk1339 View Post
Should all of these be put under OnTakeDamage?
I second the above (with a 't' at the 3rd word before the end).
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
mikehawk1339
Member
Join Date: May 2011
Old 09-15-2012 , 22:56   Re: [CSS] One hit kill with knife
Reply With Quote #16

Quote:
Originally Posted by Doc-Holiday View Post
On take damge is to modify the stuff... The event notification - play_hurt - can be used for the rest of the stuff. If your using the hook already just place them there. If your not modifying the info then the even works fine.
That is currently where I have the hook, is on player_hurt along with the other 2 things I mentioned. The code in my original post is the line I used however nothing happens.
mikehawk1339 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-15-2012 , 23:39  
Reply With Quote #17

Quote:
Originally Posted by mikehawk1339 View Post
That is currently where I have the hook, is on player_hurt along with the other 2 things I mentioned. The code in my original post is the line I used however nothing happens.
If your hooking damage like the guy showed above just do your stuff there.
Doc-Holiday is offline
mikehawk1339
Member
Join Date: May 2011
Old 09-16-2012 , 16:46   Re: [CSS] One hit kill with knife
Reply With Quote #18

Quote:
Originally Posted by Doc-Holiday View Post
If your hooking damage like the guy showed above just do your stuff there.
Pardon for me sound dumb, but are you referring to this post?

Quote:
Originally Posted by RedSword View Post
I'd use :

Code:
public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    decl String:szWeapon[16];
    GetClientWeapon(attacker, szWeapon, sizeof(szWeapon));
    if ( !StrEqual( szWeapon, "weapon_knife" ) )
        return Plugin_Continue;

    damage = 1337.0;
}
Rather than inputing new damage source... =/
mikehawk1339 is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 09-16-2012 , 17:02   Re: [CSS] One hit kill with knife
Reply With Quote #19

He means that rather than hooking the damage event AND using the SDKHook for the damage, only use the SDKHook with the damage, that way you centralize all the actions surrounding the damage in one function.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-16-2012 , 17:06  
Reply With Quote #20

Quote:
Originally Posted by RedSword View Post
He means that rather than hooking the damage event AND using the SDKHook for the damage, only use the SDKHook with the damage, that way you centralize all the actions surrounding the damage in one function.
Thank you for clearing my message up... I only speak English and most foreigners speak it better than me lol
Doc-Holiday 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 23:48.


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