Hello. I've added a plugin which adds armor and hp if bought from an extra items menu.
Everything works fine but every map change it duplicates in zp_extraitems.ini
All extraitems.ini file is flooded with armor/hp extraitem. Could I stop this plugin make duplicating settings to zp_extraitems.ini? I thought it's because of using "\r" but removing this from code and leaving as "Armor+ [100]" in the code didn't helped, it's still duplicating every map change. Is it possible to keep it but prevent it from overwriting?
Plugin code:
HTML Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define NAME "mkod_steam_pack"
#define VERSION "1.0"
#define AUTHOR "MKOD"
new g_itemid_harmor, g_itemid_hhealth, g_itemid_zhealth
const g_harmor_num = 100
const g_harmor_max = 300
const g_hhealth_num = 100
const g_hhealth_max = 300
const g_zhealth_num = 1000
const g_zhealth_max = 15000
public plugin_init()
{
register_plugin(NAME, VERSION, AUTHOR)
g_itemid_harmor = zp_register_extra_item("Armor+ \r[100]", 15, ZP_TEAM_HUMAN)
g_itemid_hhealth = zp_register_extra_item("HP+ \r[100]", 25, ZP_TEAM_HUMAN)
g_itemid_zhealth = zp_register_extra_item("HP+ \r[1000]", 15, ZP_TEAM_ZOMBIE)
}
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_harmor)
{
set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue) + g_harmor_num, g_harmor_max)))
}
else if(itemid == g_itemid_hhealth)
{
set_pev(player, pev_health, float(min(pev(player, pev_health) + g_hhealth_num, g_hhealth_max)))
}
else if(itemid == g_itemid_zhealth)
{
set_pev(player, pev_health, float(min(pev(player, pev_health) + g_zhealth_num, g_zhealth_max)))
}
return PLUGIN_HANDLED
}