Jump to content

[ZP] Extra Health


LondoN eXtream

Recommended Posts

Zombie cumpara: 1k HP cu => 30 Ammo

Human cumpara 100 HP cu => 15 ammo

 

Nume: [ZP] Extra health

Autor: dK^aLeX

Versiune: 1.0

 

Download:

#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < zombieplague >
#include < cstrike >
 
public plugin_init()
{
register_plugin("[ZP] Extra Healt", "1.0", "dK^aLeX")
 
zp_register_extra_item("Extra Healt [100]", 15, ZP_TEAM_HUMAN)
zp_register_extra_item("Extra Healt [1000]", 30, ZP_TEAM_ZOMBIE)
 
register_clcmd("say", "Check")
register_clcmd("say_team", "Check")
register_clcmd("/healt", "iHealt")
register_clcmd("say_team /healt", "iHealt")
 
register_dictionary("zdark_extra_healt.txt")
}
 
public zp_extra_item_selected(id, itemid)
{
if(!is_user_bot(id) && !is_user_hltv(id))
{
return;
}
 
if(!is_user_alive(id))
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NOT_ALLIVE")
return;
}
 
new CsTeams:userTeam = cs_get_user_team(id)
 
if(userTeam == ZP_TEAM_HUMAN)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
if(szAmmoCount < 15)
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO")
return;
}
set_user_health(id, 100)
zp_set_user_ammo_packs(id, - 15)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT")
}
 
if(userTeam == ZP_TEAM_ZOMBIE)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
if(szAmmoCount < 30)
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO2")
return;
}
 
set_user_health(id, 1000)
zp_set_user_ammo_packs(id, - 30)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT2")
}
}
 
public Check(id)
{
new szSay[192]
read_args(szSay, sizeof(szSay) -1)
remove_quotes(szSay)
 
if(contain(szSay, "buy_healt") != -1)
{
if(!is_user_alive(id))
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NOT_ALIVE")
return;
}
 
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == ZP_TEAM_HUMAN)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
if(szAmmoCount < 15)
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO")
return;
}
set_user_health(id, 100)
zp_set_user_ammo_packs(id, - 15)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT")
}
 
if(userTeam == ZP_TEAM_ZOMBIE)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
if(szAmmoCount < 30)
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO2")
return;
}
set_user_health(id, 1000)
zp_set_user_ammo_packs(id, - 30)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT2")
}
}
}
 
public iHealt(id)
{
if(!is_user_bot(id) && is_user_hltv(id))
{
return;
}
 
if(!is_user_alive(id))
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NOT_ALIVE")
return;
}
 
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == ZP_TEAM_HUMAN)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
 
if(szAmmoCount < 15 )
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO")
return;
}
set_user_health(id, 100)
zp_set_user_ammo_packs(id, - 15)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT")
}
 
if(userTeam == ZP_TEAM_ZOMBIE)
{
new szAmmoCount = zp_get_user_ammo_packs(id)
 
if(szAmmoCount < 30)
{
client_print(id, print_chat, "%L", LANG_PLAYER, "NO_AMMO")
return;
}
set_user_health(id, 1000)
zp_set_user_ammo_packs(id, - 30)
client_print(id, print_chat, "%L", LANG_PLAYER, "EXTRA_HEALT2")
}
}

Data/lang

 

[en]
NO_AMMO = ^x04[ZP]^x03 You don't have enought ammo packs! Required: ^x04 15 ^x03
NOT_ALIVE = ^x04[ZP]^x03 You must be alive!
EXTRA_HEALT = ^x04[ZP]^x03 You buyed ^x04100^x03 health points.
NO_AMMO2 = ^x04[ZP]^x03 You don't have enought ammo packs! Requied: ^x03 30 ^x03
EXTRA_HEALT2 = ^x04[ZP]^x03 You buyed ^x041000^x03 health points.
 
[ro]
NO_AMMO = ^x04[ZP]^x03 Nu ai destule ammo! Iti trebuie : ^x04 15 ^x03
NOT_ALIVE = ^x04[ZP]^x03 Pentru a cumpara acest item trebuie sa fi in viata!
EXTRA_HEALT = ^x04[ZP]^x03 Ai cumparat ^x04100^x04 puncte de viata.
NO_AMMO2 = ^x04[ZP]^x03 Nu ai destule ammo! Iti trebuie: ^x04 30 ^x03
EXTRA_HEALT2 = ^x04[ZP]^x03 Ai cumparat ^x041000^x03 puncte de viata.
[/code]



			
				


	Edited  by dK^aL3X
	
	

			
		
  • Like 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...