ok, so here it is i'm trying to make a say "jump" command instead of buying it from Extra items. ok heres the code. please fix it or help me
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
/*============================================ ================================*/
new const g_item_cost = 15 // Cost of Multijump
// Say command through which multijump is bought
new const g_buymultijump_clcmd[] = "say jump"
new const g_multijump_amount = 1 // Amount of multijumps given on purchase
new const g_multijump_limit = 2 //Max multijumps a human can jump
/*============================================ ================================*/
public plugin_init()
{
register_plugin("[ClanD] Extra Item: Multijump", "1.0", "Ownedin3d!")
register_clcmd(g_buymultijump_clcmd, "hook_say")
}
// Human buys our upgrade, give him some multijumps
public hook_say(id)
{
if (!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_ammo_packs(id) < g_item_cost)
return PLUGIN_CONTINUE;
new current_multijump = pev(id, pev_multijumpvalue)
if (current_multijump >= g_multijump_limit)
{
client_print(id, print_chat, "[ClanD] The Maximum Jumps Is 2")
return PLUGIN_CONTINUE;
}
set_pev(id, pev_multijumpvalue, float(current_multijump + g_multijump_amount))
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - g_item_cost)
return PLUGIN_HANDLED;
}
i appreciate to everyone who tried.