Raised This Month: $ Target: $400
 0% 

Knife atack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-06-2007 , 02:41   Knife atack
Reply With Quote #1

hi.I want to make something like this... but,dunno:
*When a player(atacker) hit a victim with knife...,The health of victim decrase with 5hp per second!

Thanks.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-06-2007 , 06:26   Re: Knife atack
Reply With Quote #2

Code:
#include <amxmodx> #include <csx> #include <fun> public plugin_init() {     register_plugin("","",""); } public client_damage(attacker,victim,damage,weapon,hitplace,TA) {     if(!attacker || !is_user_alive(victim))         return;             if(weapon != CSW_KNIFE)         return;         set_task(1.0,"decrease_health", victim+35435,"",0, "b") } public decrease_health(taskid) {     new victim = taskid - 35435;         new health = get_user_health(victim);         if(health == 0)         remove_task(victim+35435);             set_user_health(victim, health - 5); }

Last edited by SAMURAI16; 04-06-2007 at 10:50.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Rolnaaba
Veteran Member
Join Date: May 2006
Old 04-06-2007 , 10:49   Re: Knife atack
Reply With Quote #3

wouldnt you do:
Code:
if(health == 0)         remove_task(victim+35435);
since the set_task's taskid is the victim+35435?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-06-2007 , 10:51   Re: Knife atack
Reply With Quote #4

Quote:
Originally Posted by Rolnaaba View Post
wouldnt you do:
Code:
if(health == 0) remove_task(victim+35435);

since the set_task's taskid is the victim+35435?
ups, my fault. Thanks
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-06-2007 , 12:06   Re: Knife atack
Reply With Quote #5

oh...Thanks...

I found a bug:When i hit someone with knife...and the round is finished, on nextround he continue to bleed(health decrase) Can you fix this?Thanks...
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 04-06-2007 at 13:20.
Alka is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-06-2007 , 15:38   Re: Knife atack
Reply With Quote #6

Code:
if(health < 0)         remove_task(victim+35435);
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-06-2007 , 15:51   Re: Knife atack
Reply With Quote #7

Ok..Thanks...hope to work!
__________________
Still...lovin' . Connor noob! Hello
Alka 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 06:40.


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