Raised This Month: $ Target: $400
 0% 

Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlueDevil
Junior Member
Join Date: Mar 2006
Old 04-21-2006 , 19:20   Damage
Reply With Quote #1

Whats the code to make the victim lose x hp each second?
x shall be a cvar.
BlueDevil is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 04-21-2006 , 19:30  
Reply With Quote #2

it's this:

Code:
oh, I lost the code somehow
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
KoST
Senior Member
Join Date: Jul 2005
Old 04-21-2006 , 21:54  
Reply With Quote #3

if 'victim' is a player who has hp<100:

Code:
#include <amxmodx> #define PLUGIN "MightyVictimBash0r" #define VERSION "1.0" #define AUTHOR "KoST" new max_players; public plugin_init(){     register_plugin(PLUGIN,VERSION,AUTHOR)     register_cvar("x","1")     max_players=get_maxplayers()     set_task(1.0,"bash0r",_,_,_,"b") } public bash0r(){     for (new i=1;i<=max_players;i++){         if (is_user_alive(i) && get_user_health(i)<100){             new userid=get_user_userid(i)             server_cmd("amx_slap #%d %d",userid,get_cvar_num("x"))         }     } }

note: this plugin is a good way to get the server empty ! tested and works...
__________________
KoST is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-21-2006 , 22:43  
Reply With Quote #4

Or if victim is player you pick.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("amx_gaben", "gaben", ADMIN_SLAY)     register_cvar("hp_amount", "10") } public gaben(id, level, cid) {     if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED             new szArg[32]     read_argv(1, szArg, 31)     new Target = cmd_target(id, szArg, 3)         new szArg2[3]     read_argv(2, szArg2, 2)     new Times = str_to_num(szArg2)         if (Target && is_user_alive(Target)) //Forgot to check if alive, thx v3x.         set_task(1.0, "loosehp", id + 69, "", 0, "a", Times)             return PLUGIN_HANDLED } public loosehp(TaskID) {     new id = TaskID - 69         if (!is_user_alive(id))     {         remove_task(id + 69)         return PLUGIN_CONTINUE     }         set_user_health(id, get_user_health(id) - get_cvar_num("hp_amount"))         return PLUGIN_CONTINUE }
__________________
FatalisDK is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-21-2006 , 22:46  
Reply With Quote #5

Remember to check if the player is alive. If he's not you can either remove the task or not set his health so it does so when it's alive again.
__________________
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
BlueDevil
Junior Member
Join Date: Mar 2006
Old 04-22-2006 , 08:33  
Reply With Quote #6

i mean like if you do a command the target loses 1 hp each second untills he dies or if you cancel the command
BlueDevil is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-22-2006 , 08:36  
Reply With Quote #7

FatalisDK just did that.
__________________
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
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-22-2006 , 08:44  
Reply With Quote #8

Use amx_loosehp <name> <how many times to loose hp>
0 means loose hp until death.
Use the same command to cancel the loosehp.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("amx_loosehp", "loosehp_cmd", ADMIN_SLAY)     register_cvar("amx_looseamount", "1") } public loosehp_cmd(id, level, cid) {     if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED         new szArg[32]     read_argv(1, szArg, 31)     new Target = cmd_target(id, szArg, 3)         new szArg2[3]     read_argv(2, szArg2, 2)     new Times = str_to_num(szArg2)         if (!Times)         Times = 100         if (Target && is_user_alive(Target)) //Forgot to check if alive, thx v3x.         if (!task_exists(id + 69)) set_task(1.0, "loosehp", id + 69, "", 0, "a", Times)         else remove_task(id + 69)         return PLUGIN_HANDLED } public loosehp(TaskID) {     new id = TaskID - 69         if (!is_user_alive(id))     {         remove_task(id + 69)         return PLUGIN_CONTINUE     }         set_user_health(id, get_user_health(id) - get_cvar_num("amx_looseamount"))         return PLUGIN_CONTINUE }
__________________
FatalisDK 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 05:00.


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