Agregar Armas a ZOMBIE APOCALYPSE
#1
Hola... como estan : ) para que de antemano no me digan "VAGO" o "HOLGAZÁN" eh estado buscando hasta del mismo creador del MOD respuestas pero no las eh hayado acerca de como agregar un arma nueva a la CATEGORIA "E" de armas especiales con 10 resets en mi caso ENCONTRE ESTO http://www.gaminga.com/foros/plugins-and...leans.html "No quiero hacer spam solo comparto para que vean que busque" pero sigo sin entender es decir, yo mucho de pawn no se solo consigo el sma lo comparo con algunos otros que modifique muchas veces tengo que pasarmela dias buscando una solucion buscando informacion pero esta vez no pude queria adaptar esta arma:
https://forums.alliedmods.net/showthread.php?t=149025 (DEJE EL SMA PARA DESCARGAR)

en mi MOD Zombie pero la verdad no se como hubicarlo en cada parte : /

Dejo EL SMA de mi mod y su include


Archivos adjuntos
.sma   Descargar AMXX / zp_extra_svdex.sma (Tamaño: 18.54 KB / Descargas: 87)
.sma   Descargar AMXX / zombie_apocalypse.sma (Tamaño: 500.89 KB / Descargas: 182)
.inc   zombieapocalypse.inc (Tamaño: 17.49 KB / Descargas: 85)
Responder
#2
Ando en el cel pero vete a
show_menu_special
agrega el item luego vete a public menu_special y agrega un nuevo case creo que el 5 y pones buy_extraitem(elnumero, free) algo asi cuando este en la pc te muestro
Todos los MODS VHL totalmente gratuitos  Descarga Aqui

Mis plugins:
STEAM: https://steamcommunity.com/id/Metrikcz/
FB: fb.com/rwoong
Venta plugins a pedido en México mándame MP
Responder
#3
(02/01/2014, 02:04 AM)Metrikcz escribió: Ando en el cel pero vete a
show_menu_special
agrega el item luego vete a public menu_special y agrega un nuevo case creo que el 5 y pones buy_extraitem(elnumero, free) algo asi cuando este en la pc te muestro

Claro pero eso seria creo y sin sonar ignorante QUE ME QUERES AYUDAR A AGREGAR UN EXTRA ITEM

Pero lo que realmente quiero es agregarlo al MENU DE ARMAS ZOMBIE POR LVLS.

Por cierto Gracias por contestar rapido : )
Responder
#4
Te pongo un ejemplo, balas infinitas en menu extra por nivel:

Código PHP:
/*================================================================================
    
    -------------------------------------------
    -*- [ZP] Extra Item: Unlimited Clip 1.0 -*-
    -------------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This item/upgrade gives players unlimited clip ammo for a single round.
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieapocalypse>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const NameItem[] = { "Balas Infinitas (1 ronda)" };
const 
LevelItem 50
const CostItem 100
const TeamItem ZP_TEAM_HUMAN

/*============================================================================*/

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4

// Max Clip for weapons
new const MAXCLIP[] = { -113, -11017, -1303013020253035251220,
            
10301008303020273030, -150 }

new 
g_itemid_infammog_has_unlimited_clip[33]

public 
plugin_init()
{
    
register_plugin("[ZP] Extra: Balas Infinitas""1.0""MeRcyLeZZ")
    
    
g_itemid_infammo za_register_extra_item(NameItemLevelItemCostItemTeamItem);    
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}

// Player buys our upgrade, set the unlimited ammo flag
public zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_infammo)
        
g_has_unlimited_clip[player] = true
}

// Reset flags for all players on newround
public event_round_start()
{
    for (new 
idid <= 32id++) g_has_unlimited_clip[id] = false;
}

// Unlimited clip code
public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
// Player doesn't have the unlimited clip upgrade
    
if (!g_has_unlimited_clip[msg_entity])
        return;
    
    
// Player not alive or not an active weapon
    
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2// get weapon ID
    
clip get_msg_arg_int(3// get weapon clip
    
    // Unlimited Clip Ammo
    
if (MAXCLIP[weapon] > 2// skip grenades
    
{
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        
if (clip 2// refill when clip is nearly empty
        
{
            
// Get the weapon entity
            
static wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
// Set max clip on weapon
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);


No lo he probado, pero compila, creo que si funcionará, lo que hice es seguir los pasos de ChileScripting como lo explica:

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <zombieapocalypse>

#define PLUGIN "New Plug-In"
#define VERSION 
#define AUTHOR 

new const NameItem[] = "Super Kit"
const LevelItem 7
const CostItem 15
const TeamItem ZP_TEAM_HUMAN

new gNewItem

#define HPAMMOUNT 300.0
#define ARMORAMMOUNT 500.0

public plugin_init() {
    
register_plugin("[ZA] New Extra-Item""1.0""ChileScripting")
    
    
// Add your code here...
    
gNewItem za_register_extra_item(NameItemLevelItemCostItemTeamItem)
}

public 
zp_extra_item_selected(idITEM)
{
    if(
ITEM == gNewItem// si el item seleccionado es el item gNewItem
    
{
        static 
PlayerName[35// crear variable 35 celdas
        
get_user_name(idPlayerNamecharsmax(PlayerName)) // obtener nombre de id
        
        
entity_set_float(idEV_FL_healthentity_get_float(idEV_FL_health) + HPAMMOUNT// damos health points a id
        
entity_set_float(idEV_FL_armorvalueentity_get_float(idEV_FL_armorvalue) + ARMORAMMOUNT// armor 
        
        
client_print(0print_chat"[ZA] %s ha comprado %s"PlayerNameNameItem// print
        
client_cmd(id"spk items/smallmedkit1.wav"// play the sound (default sound half life)
    
}


Te explico un poco como lo hice yo...

Cambias:
Código PHP:
include #zombieplague 
Por:
Código PHP:
include #zombieapocalypse 

Quitas:
Código PHP:
new const g_item_name[] = { "Balas Infinitas (1 ronda)" }
const 
g_item_cost 10 

Agregas:
Código PHP:
new const NameItem[] = { "Balas Infinitas (1 ronda)" };
const 
LevelItem 50
const CostItem 100
const TeamItem ZP_TEAM_HUMAN 

Cambias:
Código PHP:
g_itemid_infammo zp_register_extra_item(g_item_nameg_item_costZP_TEAM_HUMAN

Por:
Código PHP:
g_itemid_infammo za_register_extra_item(NameItemLevelItemCostItemTeamItem); 

Bueno y eso es todo creo que no me dejé nada de la guia.

Fuente: https://forums.alliedmods.net/showthread.php?t=207308

Saludos!
Responder
#5
(02/01/2014, 08:47 AM)xPecie escribió: Te pongo un ejemplo, balas infinitas en menu extra por nivel:

Código PHP:
/*================================================================================
    
    -------------------------------------------
    -*- [ZP] Extra Item: Unlimited Clip 1.0 -*-
    -------------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This item/upgrade gives players unlimited clip ammo for a single round.
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieapocalypse>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const NameItem[] = { "Balas Infinitas (1 ronda)" };
const 
LevelItem 50
const CostItem 100
const TeamItem ZP_TEAM_HUMAN

/*============================================================================*/

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4

// Max Clip for weapons
new const MAXCLIP[] = { -113, -11017, -1303013020253035251220,
            
10301008303020273030, -150 }

new 
g_itemid_infammog_has_unlimited_clip[33]

public 
plugin_init()
{
    
register_plugin("[ZP] Extra: Balas Infinitas""1.0""MeRcyLeZZ")
    
    
g_itemid_infammo za_register_extra_item(NameItemLevelItemCostItemTeamItem);    
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}

// Player buys our upgrade, set the unlimited ammo flag
public zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_infammo)
        
g_has_unlimited_clip[player] = true
}

// Reset flags for all players on newround
public event_round_start()
{
    for (new 
idid <= 32id++) g_has_unlimited_clip[id] = false;
}

// Unlimited clip code
public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
// Player doesn't have the unlimited clip upgrade
    
if (!g_has_unlimited_clip[msg_entity])
        return;
    
    
// Player not alive or not an active weapon
    
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2// get weapon ID
    
clip get_msg_arg_int(3// get weapon clip
    
    // Unlimited Clip Ammo
    
if (MAXCLIP[weapon] > 2// skip grenades
    
{
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        
if (clip 2// refill when clip is nearly empty
        
{
            
// Get the weapon entity
            
static wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
// Set max clip on weapon
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);


No lo he probado, pero compila, creo que si funcionará, lo que hice es seguir los pasos de ChileScripting como lo explica:

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <zombieapocalypse>

#define PLUGIN "New Plug-In"
#define VERSION 
#define AUTHOR 

new const NameItem[] = "Super Kit"
const LevelItem 7
const CostItem 15
const TeamItem ZP_TEAM_HUMAN

new gNewItem

#define HPAMMOUNT 300.0
#define ARMORAMMOUNT 500.0

public plugin_init() {
    
register_plugin("[ZA] New Extra-Item""1.0""ChileScripting")
    
    
// Add your code here...
    
gNewItem za_register_extra_item(NameItemLevelItemCostItemTeamItem)
}

public 
zp_extra_item_selected(idITEM)
{
    if(
ITEM == gNewItem// si el item seleccionado es el item gNewItem
    
{
        static 
PlayerName[35// crear variable 35 celdas
        
get_user_name(idPlayerNamecharsmax(PlayerName)) // obtener nombre de id
        
        
entity_set_float(idEV_FL_healthentity_get_float(idEV_FL_health) + HPAMMOUNT// damos health points a id
        
entity_set_float(idEV_FL_armorvalueentity_get_float(idEV_FL_armorvalue) + ARMORAMMOUNT// armor 
        
        
client_print(0print_chat"[ZA] %s ha comprado %s"PlayerNameNameItem// print
        
client_cmd(id"spk items/smallmedkit1.wav"// play the sound (default sound half life)
    
}


Te explico un poco como lo hice yo...

Cambias:
Código PHP:
include #zombieplague 
Por:
Código PHP:
include #zombieapocalypse 

Quitas:
Código PHP:
new const g_item_name[] = { "Balas Infinitas (1 ronda)" }
const 
g_item_cost 10 

Agregas:
Código PHP:
new const NameItem[] = { "Balas Infinitas (1 ronda)" };
const 
LevelItem 50
const CostItem 100
const TeamItem ZP_TEAM_HUMAN 

Cambias:
Código PHP:
g_itemid_infammo zp_register_extra_item(g_item_nameg_item_costZP_TEAM_HUMAN

Por:
Código PHP:
g_itemid_infammo za_register_extra_item(NameItemLevelItemCostItemTeamItem); 

Bueno y eso es todo creo que no me dejé nada de la guia.

Fuente: https://forums.alliedmods.net/showthread.php?t=207308

Saludos!


Muchas gracias ._. te mataste haciendo la explicacion de adaptacion pero creo que aun no soy especifico : ( lo que yo queria es "Agregar el arma A EL MENU DE "ARMAS"" DE CATEGORIA "F" de mi zombieapocalypse.

De verdad creo que lo que hiciste le servira a cualquiera que busque por que yo aprendi a adaptar viendo otros plugins ya adaptados y con errores aunque ya luego me di cuenta de que baneado habia publicado como adaptarlo : P muchas gracias por tomarte tu tiempo para tratar de explicarme... SALUDOS Sonrisa
Responder
#6
Si, lo que yo te puse es para poner item extra al zpa 4.6, entendí mal, pero weno, supongo que servirá.
Responder
#7
La verdad que yo tambien tengo ese problema osea yo añado las armas tal cuales como están en la categoria E pero entonces el arma me sale pero la elijo y no me sale nada y cuando le doy a m1 comprar armas me dice [ZA] Ya as comprado armas!
Entonces respondiendo tu tema yo conosco el dueño del mod esta en una comunidad de un server que utiliza su mod y la verdad que ese server tiene 50 reset cada 2 reset te desblokea una nueva categoria de armas unas congelan otras queman, mas daño, plasma, y daño x5 esas son las categorias si quieres contactalo aqui

[email protected] este es el correo del creador o contactalo aqui en el foro de la comunidad

www.clanzonazero.com hay sale con su nick RauliTop

bueno espero que me ayuden con eso de las armas Oh god why
Responder
#8
Revivan el tema... sigo sin entender D:! CutecryCutecryCutecry
Responder
#9
El man acá no obtuvo la solución, te recomendaría abrir un NUEVO tema para saber tu problema exacto. Whatever
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#10
(14/04/2018, 06:39 PM)Hypnotize escribió: El man acá no obtuvo la solución, te recomendaría abrir un NUEVO tema para saber tu problema exacto. Whatever
x2
Steam
Responder
#11
Vale, Gracias
Responder
#12
DONDE QUEDA EL SMA O EL AMXX DE EXTRA ITEM ?[font=Impact]
Responder
#13
Como puedo agregar mas categoria como A;Z;J;H;N
Responder
#14
https://amxmodx-es.com/Thread-ZA-Agregar...y-sencilla guiate un poco por esto
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
___________▀█▄▀▄▀██████__▀█▄▀▄▀██████
_____________▀█▄█▄███▀______▀█▄█▄███▀
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)