AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to do the Vampiric Arua (steal HP)? (https://forums.alliedmods.net/showthread.php?t=29343)

Rolnaaba 06-03-2006 18:16

How to do the Vampiric Arua (steal HP)?
 
what is a good way to make it so when you shoot someone you get some health back (Vamp. Arua War3 mod kinda thing)? the only .sma of War3 I have is UWC3 and its not very helpful. if someone can tell me how to do this, or even better give me a link for War3FT.sma file or original War3.sma files so I can look it up myself I would be very grateful

SweatyBanana 06-03-2006 18:37

Check out v3x's mirror damage plugin for help.

v3x 06-04-2006 02:16

this may or may not work:
Code:
#include <amxmodx> #include <fun> #define MAX_HP  100 new CVAR_MOD; public plugin_init() {     register_plugin("Mask of death" , "0.2" , "v3x");     register_event("Damage" , "Event_Damage" , "b" , "2>0");     CVAR_MOD = register_cvar("mp_maskofdeath" , "1"); } public Event_Damage(id) {     if(!get_pcvar_num(CVAR_MOD))         return PLUGIN_CONTINUE;     new attacker = get_user_attacker(id);     if((read_data(2) / 2) > MAX_HP)         return PLUGIN_CONTINUE;     if(!is_user_alive(attacker) || id == attacker)         return PLUGIN_CONTINUE;     new hp = get_user_health(attacker) + (read_data(2) / 2);     if(hp < MAX_HP && hp > 0)         set_user_health(id , hp);     else         set_user_health(id , MAX_HP); // or 100     return PLUGIN_CONTINUE; }

Xanimos 06-04-2006 02:30

For reference multiplying by .5 is faster than dividing by two.
Also you may get a tag mismatch with that.


All times are GMT -4. The time now is 16:22.

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