Raised This Month: $ Target: $400
 0% 

un-killing Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 06-29-2007 , 08:04   un-killing Players
Reply With Quote #1

I'll try and keep this one as short as I can ...

I want a strength stat to adjust the damage dealt on hit.

I'm fairly sure I have extra damage working, and even killing player if this extra damage should take them to hp <= 0.
But I haven't really figured how I can get it so that if damage (without adjustment) would have killed player, but with the decreased damage would not kill them then the player should not be killed.

I'm not overly familiar with the events, but I'm pretty sure that when we get the client_damage() event, the client has already been damaged / killed, making this a fair bit of hassle ...

So is this at all easy to do?

(I don't think posting my code would actually help anyone, but if it would just say)
purple_pixie is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 06-29-2007 , 14:51   Re: un-killing Players
Reply With Quote #2

You can only do this with the Ham Sandwich Module.

Here's an example:

Code:
#include <amxmodx> #include <hamsandwich> #define PLUGIN "Damage Half" #define VERSION "1.0" #define AUTHOR "stupok69" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_TakeDamage, "player", "player_hurt") } public player_hurt(this, idinflictor, idattacker, Float:damage, damagebits) {     if(is_user_alive(idattacker))     {         damage *= 0.5 //half damage                 ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, damage, damagebits)         return HAM_SUPERCEDE     }         return HAM_IGNORED }
stupok is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 06-29-2007 , 19:13   Re: un-killing Players
Reply With Quote #3

Very handy - thank you.
purple_pixie 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 14:38.


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