AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Healthkit on dead body (https://forums.alliedmods.net/showthread.php?t=81132)

tuty 11-28-2008 12:59

Healthkit on dead body
 
1 Attachment(s)
Kit on body
by tuty

Description:

-
when a player dies, on his body will appear a health-kit. You can pick it up to restore your HP


Cvars:

-
kit_enable - 1 - plugin enabled, 0 - plugin disabled;
- kit_glow - 1 - enable the kit glow, white glow is more realistic :D / 0 - disable glow
- kit_fade - 1 - enable a red short screen fade when you take the kit, :) is cool try it :)
- kit_remove - 1- remove or not kit on round start? 1 - enabled / 0 - disabled
- kit_health - "20" - set here the life bonus when you pickup a kit
- kit_limit_health - "100" - set here the health limit. ( you must have less health than this cvar to take the kit )


Modules:

- fakemeta


Note:

- players with full HP can't take the kit :) also, the kit remain on ground
- when dead body dissapear, the kit remain on ground
- thanx to arkshine
- added itempickup effect
- fixed and optimized the code



crazyeffect 11-28-2008 13:04

Re: Healthkit on dead body
 
Nice plugin :D

Is it the health pack from 28WL zombie mod?

xPaw 11-28-2008 13:04

Re: Healthkit on dead body
 
haha owned :D
http://forums.alliedmods.net/showthread.php?t=24844
http://forums.alliedmods.net/showthread.php?t=54967

tuty 11-28-2008 13:05

Re: Healthkit on dead body
 
is mini medicinal kit from hl1 :-/

crazyeffect 11-28-2008 13:06

Re: Healthkit on dead body
 
http://forums.alliedmods.net/showthread.php?t=54967 Has nothing to do with it...

http://forums.alliedmods.net/showthread.php?t=24844
Looks me the same, but this has a model :D

tuty 11-28-2008 13:06

Re: Healthkit on dead body
 

i understand..and look at this


http://forums.alliedmods.net/showthr...t=24844&page=2



at
knekter post o.Ohttp://forums.alliedmods.net/images/...ost_spacer.gif

Arkshine 11-28-2008 13:30

Re: Healthkit on dead body
 
- Don't use ResetHud... See the proper event in the tuto section.
- No need to include fm_ function, juste use #include <fakemeta_util>
- MSG_ONE -> MSG_ONE_UNRELIABLE
- equal i-> equal ( or better using Ham_Touch )
- You check the health but what about player who have its max health > 100 ?
- You still use fm_give_item() but it should not need ( Not sure, I will test myself )

tuty 11-28-2008 13:50

Re: Healthkit on dead body
 
Quote:

Originally Posted by arkshine (Post 719679)
- Don't use ResetHud... See the proper event in the tuto section.
- No need to include fm_ function, juste use #include <fakemeta_util>
- MSG_ONE -> MSG_ONE_UNRELIABLE
- equal i-> equal ( or better using Ham_Touch )
- You check the health but what about player who have its max health > 100 ?
- You still use fm_give_item() but it should not need ( Not sure, I will test myself )


- You check the health but what about player who have its max health > 100 ? ---done :)

- equal i-> equal ( or better using Ham_Touch )--- used equal
- MSG_ONE -> MSG_ONE_UNRELIABLE --- thanx


- No need to include fm_ function, juste use #include <fakemeta_util> ---------lol oke,.....



Arkshine 11-28-2008 14:13

Re: Healthkit on dead body
 
Just tested fastly a code. I hope you won't hate me. This code is enough to spawn and be able to touch an healthkit. No need to use FM_Touch, nor testing about the health or giving the item. By spawning this entity, the engine does what it needs.

Code:
    #include <amxmodx>     #include <fakemeta>         new const gs_HealthKitClassname[] = "item_healthkit";     new gi_HealthKit;         public plugin_precache ()     {            precache_model ( "models/w_medkit.mdl" );    // --| Wolrd model.         precache_sound ( "items/smallmedkit1.wav" ); // --| Sound played on touch.     }         public plugin_init ()     {         register_event ( "DeathMsg", "Event_PlayerKilled", "a" );         gi_HealthKit = engfunc ( EngFunc_AllocString, gs_HealthKitClassname )     }     public Event_PlayerKilled ()     {         // --| Initialize variables.         static Float:vf_Origin[ 3 ], i_Healthkit;             // --| Get the victim's index. / Retrieve the current victim's origin.         pev ( read_data ( 2 ), pev_origin, vf_Origin );                 // --| Create our health kit.         if ( ( i_Healthkit = engfunc ( EngFunc_CreateNamedEntity, gi_HealthKit ) ) )         {             // --| Set the entity to the current player's origin and spawn it!             set_pev ( i_Healthkit, pev_origin, vf_Origin );             dllfunc ( DLLFunc_Spawn, i_Healthkit );         }     }

Now, if you still want to add a screenfade, I recommend to use Ham_Touch. But I don't think it's really need since a sound is provided. Just my opinion.

tuty 11-28-2008 14:15

Re: Healthkit on dead body
 
and i change my code in your? ..and where is my plugin after? if is really bad unaprove it.... from mistake peoples learn :wink:

.................


All times are GMT -4. The time now is 23:49.

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