AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prevent death (https://forums.alliedmods.net/showthread.php?t=22980)

DotNetJunkie 01-08-2006 01:11

Prevent death
 
I wasn't sure about this but is it possible to prevent a player from dying
without giving them godmod?

Thanks!

Jordan 01-08-2006 11:12

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public health(id) {          new health = get_user_health(id)          if(health <= x /* <-- your number here*/)          set_user_health(id, 100)          return PLUGIN_CONTINUE }

Something like that.... the problem is that if your health isn't set to like 150, this won't work with awp regular shots or other gun headshots.

Hawk552 01-08-2006 11:31

lol

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("whatever","1.0","Hawk552");         register_event("ResetHUD","CheckHealth","be");     register_event("Damage","CheckHealth","be"); } public CheckHealth(id) {     if(get_user_health(id) < 1124)     {         set_user_health(id,1124);     }         return; }

Jordan 01-08-2006 11:40

Well I didn't know he wanted the health more than 100 :P

Hawk552 01-08-2006 11:47

It'll appear to the user as though he always has 100 HP, not 1124.

DotNetJunkie 01-08-2006 12:02

Well I tried all of that after doing some searching to discover it doesn't
work with The Specialists so I was trying something else like TSHealth but with no luck

Hawk552 01-08-2006 12:13

What?

DotNetJunkie 01-08-2006 12:33

Well I tried the examples you gave above but they do not work with
The Specialists unfortunately.

Hawk552 01-08-2006 12:45

Is there an event for being damaged in TS?

DotNetJunkie 01-08-2006 13:07

There is an event called TSHealth that is triggered when the player's
health is changed however I was unable to block the message and prevent
the player from dying.


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

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