#include < amxmodx >
#include < fakemeta >
#include < zp50_items >
#include < zp50_class_nemesis >
#include < zp50_class_survivor >
new const g_item_name [ ] = { "Vegtelen loszer [1korig]" }
const g_item_cost = 67
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
new cvar_enable_uc , cvar_allow_survivor_uc , cvar_enable_human_uc , cvar_limit_unlimited
new g_number
new const MAXCLIP [ ] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
new g_itemid_infammo, g_has_unlimited_clip[33]
public plugin_init ( ) {
register_plugin("[ZP50] Extra: Unlimited Clip","1.1","H.RED.ZONE");
g_itemid_infammo = zp_items_register ( g_item_name , g_item_cost );
cvar_enable_uc = register_cvar ( "zp_enable_plugin_uc" , "1" )
cvar_allow_survivor_uc = register_cvar ( "zp_enable_survivor_uc" , "1" )
cvar_enable_human_uc = register_cvar ( "zp_enable_human_uc" , "1" )
cvar_limit_unlimited = register_cvar ( "zp_round_limit_uc" , "1" )
register_event (" HLTV" , "event_round_start" , "a" , "1=0" , "2=0" );
register_message ( get_user_msgid ( "CurWeapon" ) , "message_cur_weapon" ); }
public zp_fw_items_select_pre ( id , itemid ) {
if ( itemid == g_itemid_infammo ) {
if ( get_pcvar_num ( cvar_enable_uc ) == 0 ) {
return ZP_ITEM_DONT_SHOW; }
if ( get_pcvar_num ( cvar_enable_human_uc ) == 0 && !zp_core_is_zombie ( id ) ) {
return ZP_ITEM_DONT_SHOW; }
if ( zp_class_nemesis_get ( id ) && zp_core_is_zombie ( id ) ) {
return ZP_ITEM_DONT_SHOW; }
if ( get_pcvar_num ( cvar_allow_survivor_uc ) == 0 && zp_class_survivor_get ( id ) ) {
return ZP_ITEM_DONT_SHOW; }
static text[32]
formatex ( text , charsmax ( text ) , "[%d/%d]" , g_number , get_pcvar_num ( cvar_limit_unlimited ) )
zp_items_menu_text_add ( text )
if ( g_number >= get_pcvar_num ( cvar_limit_unlimited ) )
return ZP_ITEM_NOT_AVAILABLE; }
return ZP_ITEM_AVAILABLE; }
public zp_fw_items_select_post ( player , itemid ) {
if ( itemid == g_itemid_infammo ) {
g_has_unlimited_clip [ player ] = true;
g_number++; } }
public event_round_start ( ) {
for ( new id; id <= 32; id++ ) g_has_unlimited_clip [ id ] = false; }
public message_cur_weapon(msg_id, msg_dest, msg_entity) {
if (!g_has_unlimited_clip[msg_entity])
return;
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;
static weapon, clip
weapon = get_msg_arg_int(2)
clip = get_msg_arg_int(3)
if (MAXCLIP[weapon] > 2) {
set_msg_arg_int (3 , get_msg_argtype ( 3 ) , MAXCLIP [ weapon ] )
if ( clip < 2 ) {
static wname [ 32 ], weapon_ent
get_weaponname ( weapon , wname , sizeof wname - 1 )
weapon_ent = fm_find_ent_by_owner ( -1 , wname , msg_entity )
fm_set_weapon_ammo ( weapon_ent , MAXCLIP [ weapon ] ); } } }
stock fm_find_ent_by_owner(entity, const classname[], owner) {
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {} return entity; }
stock fm_set_weapon_ammo(entity, amount) {
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS); }
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par }
*/