Page 1 of 1
Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 17:48
by Papo4ka
Installed Levels-XP Systems, in the file ze_extraitems.ini
I installed LEVEL = 3, but in the end, people can buy this weapon even from 1 LVL
[Fire Nade]
NAME = Fire Nade
COST = 3
LIMIT = 1
LEVEL = 3
The LVL system works, there are no errors in the logs.
Re: Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 17:52
by Raheem
Post your plugins-zombie_escape.ini
Re: Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 17:58
by Papo4ka
;Core
ze_core.amxx
;Setting API / Models
amx_settings_api.amxx
cs_weap_models_api.amxx
;Mod Addons
ze_block_events_messages.amxx
ze_effects_messages.amxx
ze_nightvision_lighting.amxx
ze_effects_frags.amxx
ze_effects_weather.amxx
ze_coins_system.amxx
ze_hud_info.amxx
ze_weapon_menu.amxx
ze_main_menu.amxx
ze_items_manager.amxx
ze_items_escape_coins.amxx
ze_items_limit.amxx
ze_madness.amxx
ze_fire.amxx
ze_frost.amxx
ze_extra_fire_nade.amxx
ze_extra_frost_nade.amxx
ze_resources.amxx
ze_countdown.amxx
ze_zombie_sounds.amxx
ze_level_system.amxx
ze_health_bar.amxx
ze_win_message.amxx
ze_extra_watergun.amxx
;Enable if needed
ze_items_level.amxx ;Level System needed.
;ze_items_vip.amxx ;VIP System needed.
Re: Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 18:05
by Raheem
OK, ze_items_level.amxx is enabled but it's probably you did not use the native
ze_set_item_level(iItemid, iLevel)
in the plugin you try to set level to, example you trying to make level for Fire Nade, you must open ze_extra_fire_nade.sma and find this line:
g_iItemID = ze_register_item("Fire Nade", 30, 1)
and add under it this line:
ze_set_item_level(g_iItemID, 3)
, so final code:
#include <zombie_escape>
// Default Sound
new const g_szBuyAmmoSound[] = "items/9mmclip1.wav"
// Variables
new g_iItemID
public plugin_init()
{
register_plugin("[ZE] Items: Fire Nade", ZE_VERSION, AUTHORS)
// Register our item
g_iItemID = ze_register_item("Fire Nade", 30, 1)
ze_set_item_level(g_iItemID, 3)
}
public ze_select_item_pre(id, itemid)
{
// Return Available and we will block it in Post, So it dosen't affect other plugins
if (itemid != g_iItemID)
return ZE_ITEM_AVAILABLE
// Available for Humans only, So don't show it for zombies
if (ze_is_user_zombie(id))
return ZE_ITEM_DONT_SHOW
return ZE_ITEM_AVAILABLE
}
public ze_select_item_post(id, itemid)
{
// This is not our item, Block it here
if (itemid != g_iItemID)
return
// Get Weapon ID
new iWpnID = get_weaponid("weapon_hegrenade")
// Player Don't have Frost Grenade then give him
if (rg_get_user_bpammo(id, WeaponIdType:iWpnID) == 0)
{
rg_give_item(id, "weapon_hegrenade", GT_APPEND)
}
else
{
// Player have, Increase his Back Pack Ammo, And play buy BP sound + Hud Flash
rg_set_user_bpammo(id, WeaponIdType:iWpnID, rg_get_user_bpammo(id, WeaponIdType:iWpnID) + 1)
emit_sound(id, CHAN_ITEM, g_szBuyAmmoSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
Show_Given_BPAmmo(id, 12, 1) // HE Grenade AmmoType Const = 12
}
}
Just compile and try.
Re: Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 18:14
by Papo4ka
Thank you, it works.
Re: Purchase of weapons from a certain LVL
Posted: 30 Jul 2019, 18:18
by Raheem
You are welcome.