Raised This Month: $ Target: $400
 0% 

A biteing command.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chex
Junior Member
Join Date: Jun 2006
Old 06-06-2006 , 15:50   A biteing command.
Reply With Quote #1

Code:
}     new bite[23]     set_task(1.0,"bite",id,_,_,"b")     set_user_health(id,600)     client_print(id,print_chat,"You sink you teeth in the person's neck.^n")     client_print(entid,print_chat,"You just got bit by a vampire!^n")     return PLUGIN_HANDLED } public bite(id){             new entid, entbody     get_user_aiming(id,entid,entbody,400)             set_user_health(entid,get_user_health(entid)-10)         return PLUGIN_HANDLED     }

I have a little problem with that. If I do the command /bite, any one I look at will start to lose health. How do I make it stop when the player dies? for some reason this does not work.
Code:
public bite(id){             new entid, entbody     get_user_aiming(id,entid,entbody,400)     if(get_user_health(entid) <=10){                          user_silentkill(entid)                       return PLUGIN_HANDLED }            else{        set_user_health(entid,get_user_health(entid)-10)         return PLUGIN_HANDLED     } return PLUGIN_HANDLED }
Chex is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-06-2006 , 16:03  
Reply With Quote #2

Code:
remove_task(id);
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Chex
Junior Member
Join Date: Jun 2006
Old 06-06-2006 , 16:30  
Reply With Quote #3

Ok that fixed it going on forever, but there is still a problem. If I use the command on some one the start to loss hp. But if I turn and look at some one else the person that I was looking at stops losing hp and the new person starts. Is there a way to fix that? Thanks.
Chex is offline
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 06-07-2006 , 15:31  
Reply With Quote #4

Yes, I think...

Replace your current settask with this
Code:
set_task(1.0,"bite",id+40,0,0,"b")

And then in public bite(id){
put this at the beginning

Code:
id -= 40

Then it sha'll work!
__________________
+karma if I am helpful to you.
I am one in a few million.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-07-2006 , 16:15  
Reply With Quote #5

Better idea:
Code:
#define TASK_BITE 98239

Code:
set_task(1.0 , "bite" , id + TASK_BITE , _ , _ , "b");

Code:
public bite(id) {   id -= TASK_BITE;   // .. }

Code:
remove_task(id + TASK_BITE);
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 16:25.


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