AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Headshot = 100HP (https://forums.alliedmods.net/showthread.php?t=28153)

jordy 05-08-2006 15:56

Headshot = 100HP
 
Hi I'm looking for a plugin so when you make a headshot you get back exactly 100hp. V3X wrote one for me but unforunately it isn't working.

Code:

#include <amxmodx>
#include <fun>

public plugin_init()
{
  register_plugin("100hp on Headshot" , "0.1" , "v3x");
  register_event("DeathMsg" , "event_DeathMsg" , "1>0" , "2>0" , "3=1");
}

public event_DeathMsg()
{
  new id = read_data(2);
  if(is_user_alive(id))
    set_user_health(id , 100);
}

can somebody recheck if its write?

KoST 05-08-2006 16:04

try this:

Code:
#include <amxmodx> #include <fun> public plugin_init() {   register_plugin("100hp on Headshot" , "0.1" , "v3x");   register_event("DeathMsg" , "event_DeathMsg" , "1>0" , "2>0" , "3=1"); } public event_DeathMsg() {   new id = read_data(1); // changed 2 -> 1   if(is_user_alive(id))     set_user_health(id , 100); }

http://wiki.amxmodx.org/index.php/Ha...vents#DeathMsg

[edit]
please use small-tags instead of code-tags to make code better readable..

jordy 05-08-2006 16:39

Nope that didn't work either.

FatalisDK 05-08-2006 17:30

Code:
#include <amxmodx> #include <fun> public plugin_init() {   register_plugin("100hp on Headshot" , "0.1" , "v3x");   register_event("DeathMsg" , "event_DeathMsg" , "a" ,  "1>0" , "2>0" , "3=1"); } public event_DeathMsg() {   new id = read_data(1); // changed 2 -> 1   if(is_user_alive(id))     set_user_health(id , 100); }

v3x 05-08-2006 17:41

LOL, oops! I forgot the flag >_<

jordy 05-08-2006 19:26

THANK!! now that works. :D

SweatyBanana 05-08-2006 19:32

Why not just disable headshots??


Code:
set_user_hitzones(0, 0, 253)

FatalisDK 05-08-2006 19:33

He wants the player he shot the other player to receive the health reward, not heal the victim.

SweatyBanana 05-08-2006 19:55

oops...my bad :comply:

VEN 05-09-2006 06:11

Quote:

Hi I'm looking for a plugin so when you make a headshot you get back exactly 100hp
HS kill or any HS shot?
Here is the code for HS hit (victim may have a helmet).

Code:
#include <amxmodx> #include <fun> #include <csx> public plugin_init() {   register_plugin("100hp on Headshot" , "0.1" , "AMXX community"); } public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) {   if(is_user_alive(attacker) && hitplace == HIT_HEAD)     set_user_health(attacker , 100); }


All times are GMT -4. The time now is 05:07.

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