11/11/2022, 12:44 PM
buenas que tal alguien me podria editar el siguiente plugin para que tenga 3 opciones mas de cuchillos de los que ya tiene?
Código PHP:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#define PLUGIN "menu cuchillos"
#define VERSION "1.5"
#define AUTHOR "[N]drs"
enum _:DATA
{
NAME[25],
V_MDL[126]
}
new const KNIFES[][DATA] = {
{"Cuchillo Normal", "models/v_knife.mdl"},
{"Valorant", "models/phantom/v_valorant.mdl"},
{"Karambit", "models/phantom/v_karambitphantom.mdl"},
{"Bayoneta m9", "models/phantom/v_m9phantom.mdl"},
{"Butterfly", "models/phantom/v_mariposaphantom.mdl"}
}
new g_iModel[33], g_iUse[33][sizeof(KNIFES) + 1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Item_Deploy, "weapon_knife", "HamItemDeploy", true)
register_clcmd("say /faka", "menu")
}
public plugin_precache()
{
for(new i; i < sizeof(KNIFES); i++)
precache_model(KNIFES[i][V_MDL])
}
public client_putinserver(id)
{
g_iUse[id][g_iModel[id]] = 0
g_iModel[id] = 0
g_iUse[id][0] = 1
}
public menu(id)
{
new text[40], iMenu = menu_create("\r[\yPhantom - Gamers\r] \wmenu de fakas", "handlermenu");
for(new i; i < sizeof(KNIFES); i++)
{
if(!g_iUse[id][i])
formatex(text, charsmax(text), "%s \r[\ySeleccionar\r]", KNIFES[i][NAME])
else
formatex(text, charsmax(text), "%s \r[Usando\r]", KNIFES[i][NAME])
menu_additem(iMenu, text, _, _)
}
menu_display(id, iMenu)
return PLUGIN_HANDLED
}
public handlermenu(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
g_iUse[id][g_iModel[id]] = 0
g_iUse[id][item] = 1
g_iModel[id] = item
client_print(id, print_chat, "[Phantom - Gamers] Seleccionaste la Faka %s", KNIFES[item][NAME])
menu_destroy(menu)
return PLUGIN_HANDLED
}
public HamItemDeploy(iEntity)
{
new id = get_pdata_cbase(iEntity, 41, 4)
entity_set_string(id, EV_SZ_viewmodel, KNIFES[g_iModel[id]][V_MDL])
}