Raised This Month: $12 Target: $400
 3% 

Healthkit on dead body


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-28-2008 , 12:59   Healthkit on dead body
Reply With Quote #1

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 / 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


Attached Files
File Type: sma Get Plugin or Get Source (kit_on_body.sma - 3708 views - 5.2 KB)
__________________

Last edited by tuty; 11-30-2015 at 13:09.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 11-28-2008 , 13:04   Re: Healthkit on dead body
Reply With Quote #2

Nice plugin

Is it the health pack from 28WL zombie mod?
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-28-2008 , 13:04   Re: Healthkit on dead body
Reply With Quote #3

haha owned
http://forums.alliedmods.net/showthread.php?t=24844
http://forums.alliedmods.net/showthread.php?t=54967
__________________
xPaw is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-28-2008 , 13:05   Re: Healthkit on dead body
Reply With Quote #4

is mini medicinal kit from hl1 :-/
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 11-28-2008 , 13:06   Re: Healthkit on dead body
Reply With Quote #5

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
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-28-2008 , 13:06   Re: Healthkit on dead body
Reply With Quote #6


i understand..and look at this


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



at
knekter post o.O
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-28-2008 , 13:30   Re: Healthkit on dead body
Reply With Quote #7

- 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 )
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-28-2008 , 13:50   Re: Healthkit on dead body
Reply With Quote #8

Quote:
Originally Posted by arkshine View Post
- 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,.....


__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-28-2008 , 14:13   Re: Healthkit on dead body
Reply With Quote #9

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.
__________________

Last edited by Arkshine; 11-28-2008 at 14:19.
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-28-2008 , 14:15   Re: Healthkit on dead body
Reply With Quote #10

and i change my code in your? ..and where is my plugin after? if is really bad unaprove it.... from mistake peoples learn

.................
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Reply


Thread Tools
Display Modes

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 04:06.


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