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

[ZP]Items Extra : more Hp human and zombie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
intoxicadooo
Veteran Member
Join Date: Mar 2009
Location: Argentina, Misiones
Old 03-16-2009 , 18:59   [ZP]Items Extra : more Hp human and zombie
Reply With Quote #1

Someone has to plug the sub when you purchase more life to the zombie and the human, please!
intoxicadooo is offline
Send a message via MSN to intoxicadooo
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-16-2009 , 19:26   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #2

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: Life"
#define VERSION "0.1"
#define AUTHOR "AlejandroSk"

new bool:g_HasLife[33]
new 
g_itemid1

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_itemid1 zp_register_extra_item("Life [150] "15ZP_TEAM_HUMAN)
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
}

public 
zp_extra_item_selected(iditem)
{
    if (
item == g_itemid1)
    {
        
g_HasLife[id] = true
        
new user_health get_user_health(id)
        
fm_set_user_health(iduser_health 150)
    }
}

public 
Fwd_PlayerSpawn_Post(id)
{
    if (
g_HasLife[id])
    {
        
g_HasLife[id] = false
    
}

not tested.
AlejandroSk is offline
Send a message via MSN to AlejandroSk
intoxicadooo
Veteran Member
Join Date: Mar 2009
Location: Argentina, Misiones
Old 03-16-2009 , 19:44   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #3

Thanks it does me out.
I'll give you karma for further help: D
intoxicadooo is offline
Send a message via MSN to intoxicadooo
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-16-2009 , 19:55   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #4

Quote:
Originally Posted by intoxicadooo View Post
Thanks it does me out.
I'll give you karma for further help: D
you tested it?
AlejandroSk is offline
Send a message via MSN to AlejandroSk
intoxicadooo
Veteran Member
Join Date: Mar 2009
Location: Argentina, Misiones
Old 03-16-2009 , 20:05   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #5

Quote:
Originally Posted by AlejandroSk View Post
you tested it?
Do not pass this 1 friend

I had to change 1 little xD

Last edited by intoxicadooo; 09-01-2009 at 10:50.
intoxicadooo is offline
Send a message via MSN to intoxicadooo
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-16-2009 , 22:21   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #6

That would be more stringent:

PHP Code:
#include <amxmodx>
#include <fakemeta_util>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: Life"
#define VERSION "0.1"
#define AUTHOR "AlejandroSk"

new g_itemid1

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_itemid1 zp_register_extra_item("Life [150] "15ZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditem)
{
    if (
item == g_itemid1)
    {
        new 
user_health get_user_health(id)
        
fm_set_user_health(iduser_health 150)
    }

__________________
alan_el_more is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 03-17-2009 , 11:45   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #7

The code just gets better on every change... It's gonna be awesome if we keep like this!
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
 
#define PLUGIN "[ZP] Extra Item: Life"
#define VERSION "0.1"
#define AUTHOR "AlejandroSk"
 
new g_itemid1
 
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_itemid1 = zp_register_extra_item("Life [150] ", 15, ZP_TEAM_HUMAN)
}
 
public zp_extra_item_selected(id, item)
   if (item == g_itemid1)
       set_pev(id, pev_health, pev(id, pev_health) + 150.0)
Though I think it can't be optimized anymore, lol...
SnoW is offline
Send a message via MSN to SnoW
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-17-2009 , 13:23   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #8

But can be better.

what about a sound?
PHP Code:
 #include <amxmodx>
#include <fakemeta>
#include <zombieplague>
 
#define PLUGIN "[ZP] Extra Item: Life"
#define VERSION "0.1"
#define AUTHOR "AlejandroSk"
 
new g_itemid1
 
public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)
g_itemid1 zp_register_extra_item("Life [150] "15ZP_TEAM_HUMAN)
}
 
 public 
plugin_precache()
 {
     
precache_sound("items/smallmedkit1.wav")
}
    
public 
zp_extra_item_selected(iditem)
   if (
item == g_itemid1)
   {
       
set_pev(idpev_healthpev(idpev_health) + 150.0)
       
emit_sound(id,CHAN_VOICE,"items/smallmedkit1.wav"1.0ATTN_NORM0PITCH_NORM)
      } 
AlejandroSk is offline
Send a message via MSN to AlejandroSk
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 03-17-2009 , 14:16   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #9

Quote:
Originally Posted by AlejandroSk View Post
But can be better.

what about a sound?
Adding new features doesn't always make a simple plugin better. I think it's perfect, lol.
OT: About the karma with comment "thanks". If you really wanna thank me, give plus karma instead of minus
SnoW is offline
Send a message via MSN to SnoW
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 03-17-2009 , 14:44   Re: [ZP]Items Extra : more Hp human and zombie
Reply With Quote #10

If you want this for zombies too, you can do:
Code:
zp_register_extra_item("Life [150] ", 15, ZP_TEAM_HUMAN | ZP_TEAM_ZOMBIE)
__________________
MeRcyLeZZ is offline
Reply



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 20:38.


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