Zombie Escape V2: Shop
Example Sub-Plugin
- v1.0.0, last updated : 04.07.2014
Zombie Escape V2: Shop is an Addon for Zombie Escape V2 which adds a Item Shop for both Humans and Zombies.
Requirements
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <zev2_core>
#include <zev2_shop>
#define PLUGIN "Zombie Escape V2: The Bloodthirster"
#define VERSION "1.0.0"
#define AUTHOR "Kia"
// ===============================================================================
// Editing begins here
// ===============================================================================
// Amount in Percent how much Life Steal you gain
#define LIFE_STEAL_PERCENT 4.0
// ===============================================================================
// and stops here. DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
// ===============================================================================
// ===============================================================================
// Variables
// ===============================================================================
/* Boolean */
new bool:g_bHasLifeSteal[33]
// ===============================================================================
// plugin_init
// ===============================================================================
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
/* ZEV2 */
ZEV2_AddItem("The Bloodthirster", 1, 25, "ZEV2_OnItemBuy") // 1 = Humans; 2 = Zombies
/* Hamsandwich */
RegisterHam(Ham_TakeDamage, "player", "Ham_OnPlayerDamage")
}
// ===============================================================================
// ZEV2_OnItemBuy
// ===============================================================================
public ZEV2_OnItemBuy(id) g_bHasLifeSteal[id] = true
// ===============================================================================
// ZEV2_OnHumanInfected
// ===============================================================================
public ZEV2_OnHumanInfected(id) if(g_bHasLifeSteal[id]) g_bHasLifeSteal[id] = false
// ===============================================================================
// ZEV2_OnZombieWin
// ===============================================================================
public ZEV2_OnZombieWin() arrayset(g_bHasLifeSteal, 0, charsmax(g_bHasLifeSteal))
// ===============================================================================
// ZEV2_OnHumanWin
// ===============================================================================
public ZEV2_OnHumanWin() arrayset(g_bHasLifeSteal, 0, charsmax(g_bHasLifeSteal))
// ===============================================================================
// Ham_OnPlayerDamage
// ===============================================================================
public Ham_OnPlayerDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
{
if(iInflictor == iAttacker && is_user_alive(iAttacker) && g_bHasLifeSteal[iAttacker])
set_user_health(iAttacker, floatround(get_user_health(iAttacker) + (fDamage / 100) * LIFE_STEAL_PERCENT))
}
Changelog
Quote:
Originally Posted by Version 1.0.0
Initial Release.
Attached Files Get Plugin or Get Source (zombie_escape_v2_shop.sma - 4.6 KB) zev2_shop.inc (361 Bytes)
Wyświetl pełny artykuł