I want it for only zombie classes. Human can use it
my mod zombie plauge 5.0.5
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#include <zp50_items>
#include <fun>
#include <colorchat>
#define PLUGIN "[ZP] Extra Item : Zombie Pack"
#define VERSION "0.1"
#define AUTHOR "MaNdo"
#define COST 20
new g_HasPack[33]
new g_itemid
new cvar_hp , cvar_longjump , cvar_speed , cvar_gravity, cvar_one_round
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_itemid = zp_items_register("Zombie Pack", COST)
register_logevent ( "Round_End", 2, "1=Round_End" )
cvar_gravity = register_cvar("zp_pack_gravity", "0.5")
cvar_hp = register_cvar("zp_pack_hp", "1000")
cvar_longjump = register_cvar("zp_pack_enable_longjump", "1")
cvar_speed = register_cvar("zp_pack_speed", "280.0")
cvar_one_round = register_cvar ( "zp50_pack_one_round", "1" )
}
public Round_End ( )
{
for ( new id=1; id <= get_maxplayers ( ); id++ )
{
if ( is_user_alive ( id ) && g_HasPack[ id ] )
{
if ( get_pcvar_num ( cvar_one_round ) )
{
g_HasPack[ id ] = 0;
}
}
}
}
public client_connect( id )
{
g_HasPack[ id ] = 0
}
public client_disconnect( id )
{
g_HasPack[ id ] = 0
}
public zp_fw_items_select_pre( id, itemid )
{
if ( itemid == g_itemid )
{
if ( zp_core_is_zombie( id ) && zp_class_nemesis_get( id ) && zp_class_survivor_get ( id ) )
{
return ZP_ITEM_NOT_AVAILABLE;
}
}
return ZP_ITEM_AVAILABLE;
}
public zp_fw_items_select_post ( id, itemid )
{
if ( itemid == g_itemid )
{
g_HasPack[id] = true;
set_user_gravity(id, get_pcvar_float ( cvar_gravity ) )
set_user_maxspeed(id, get_pcvar_float ( cvar_speed ) )
set_user_health(id, get_user_health(id) + get_pcvar_num ( cvar_hp ) )
if ( get_pcvar_num ( cvar_longjump ) )
{
give_item(id, "item_longjump")
}
ColorChat(id, GREEN, "[ZP]^x01 You have bought a ^x04Zombie Pack^x01!")
}
return ZP_ITEM_AVAILABLE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/