Raised This Month: $32 Target: $400
 8% 

Register_menu_item native


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-10-2020 , 14:54   Register_menu_item native
Reply With Quote #1

Hey, i came with a request, a plugin that does register a new menu item like on zp since i didn t understand anything from a 11k lines plugin i would like you to help me with this request. Please?
AnimalMonster is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-10-2020 , 15:43   Re: Register_menu_item native
Reply With Quote #2

What plugin exactly are you talking about?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-11-2020 , 16:09   Re: Register_menu_item native
Reply With Quote #3

You know how zombie plague registers an item into the menu? That s the pkugin im talking about
AnimalMonster is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-11-2020 , 18:20   Re: Register_menu_item native
Reply With Quote #4

Yea okay i get that, but what is your request exactle, because i can't really understand what you're trying to say here.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-11-2020 , 20:57   Re: Register_menu_item native
Reply With Quote #5

An Example:

PHP Code:
#include <amxmodx>
#include <fakemeta>
// Call Inc file
#include <zombieplague>

// Those are the items details

// Item Name
new const g_item_name[] = { "Armor (100ap)" }

// Quantity of armor
const g_armor_amount 200

// Maximum armor
const g_armor_limit 999

// Great Item IDs
new g_itemid_humanarmor


public plugin_init()
{
    
register_plugin("[ZP] Extra: Armor (100ap)""0.0.1""Supremache")
    
//Item ID              Register item     Item Name   Item Cost   Item Team
    
g_itemid_humanarmor zp_register_extra_item(g_item_name5ZP_TEAM_HUMAN)
}

// Add some items to zp menu by following those steps

public zp_extra_item_selected(iditemid)
{   
// Identifier of items  ==   Item IDs
    
if (itemid == g_itemid_humanarmor)
    {
        
// Here you can put which items do you want like ( Armor - health - weapons - etc)
        
set_pev(idpev_armorvaluefloat(min(pev(idpev_armorvalue)+ g_armor_amountg_armor_limit)))
        
        new 
player[32]
        
get_user_name(idplayercharsmax(player))        
        
client_print0print_chat"[ZP] %s just bought %s"playerg_item_name)

    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-12-2020 , 04:38   Re: Register_menu_item native
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
An Example:

PHP Code:
#include <amxmodx>
#include <fakemeta>
// Call Inc file
#include <zombieplague>

// Those are the items details

// Item Name
new const g_item_name[] = { "Armor (100ap)" }

// Quantity of armor
const g_armor_amount 200

// Maximum armor
const g_armor_limit 999

// Great Item IDs
new g_itemid_humanarmor


public plugin_init()
{
    
register_plugin("[ZP] Extra: Armor (100ap)""0.0.1""Supremache")
    
//Item ID              Register item     Item Name   Item Cost   Item Team
    
g_itemid_humanarmor zp_register_extra_item(g_item_name5ZP_TEAM_HUMAN)
}

// Add some items to zp menu by following those steps

public zp_extra_item_selected(iditemid)
{   
// Identifier of items  ==   Item IDs
    
if (itemid == g_itemid_humanarmor)
    {
        
// Here you can put which items do you want like ( Armor - health - weapons - etc)
        
set_pev(idpev_armorvaluefloat(min(pev(idpev_armorvalue)+ g_armor_amountg_armor_limit)))
        
        new 
player[32]
        
get_user_name(idplayercharsmax(player))        
        
client_print0print_chat"[ZP] %s just bought %s"playerg_item_name)

    }

You got it wrong, the system the zombie plague registers an item, not how to use the natives of zombie plague.
AnimalMonster is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-12-2020 , 08:14   Re: Register_menu_item native
Reply With Quote #7

something like this i wanted, i made it myself but i don t know how i should get the id, so this thread may be deleted because it was just a waste of time more than a request since i couldn't explain myself too detailed and the thing imma post may be going on a new thread in Scripting Help.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Zombie: The Hero Shop"
#define VERSION "1.0"
#define AUTHOR "DeclineD"

#define categories 4

new g_items
new fw_selected
new Selected[categories]

enum _:Data
{
    
name,
    
cost,
    
limit_round,
    
limit_map,
    
category,
    
bool:codeb,
    
maxlimit,
    
bool:limit_type,
    
bool:limit
}

new 
Categ[] = {
    
"Primary Weapon",
    
"Secondary Weapon",
    
"Meele Weapon"
}

new 
item_data[99][Data]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fw_spawn"1)
    
fw_selected CreateMultiForward("item_recive"ET_CONTINUEFP_CELLFP_CELLFP_CELL)
}

public 
plugin_natives()
{
    
register_native("register_item""registerFunction")
}

public 
registerFunction(item_nameitem_costitem_limititem_categorylimit_maxbool:limitonbool:codeboxbool:limit_roundd)
{
    
item_data[g_items][name] = item_name
    item_data
[g_items][cost] = item_cost
    
if(limit_roundditem_data[g_items][limit_round] = item_limit
    
else
    
item_data[g_items][limit_map] = item_limit
    item_data
[g_items][category] = item_category
    item_data
[g_items][codeb] = codeb
    item_data
[g_items][maxlimit] = limit_max
    item_data
[g_items][limit_type] = limit_roundd
    item_data
[g_items][limit] = limiton
    
    g_items
++
    
    return 
g_items-1
}

public 
weaponsMenu(id)
{
    new 
menu menu_create("Weapon Menu""weaponsHandler")
    
    for(new 
0categories-1i++)
    {
        new 
text[128]
        
        
formatex(textcharsmax(text), "\y%s \r[ \y%s \r]"Categ[i], item_data[Selected[i]][name])
        
menu_additem(menutext)
    }
    
    
menu_additem(menu"Recive Weapons")
}

public 
weaponsHandler(idmenu)
{
    switch(
menu)
    {
        case 
0Primary(id)
        case 
1Pistol(id)
        case 
2Meele(id)
        case 
4Recive(id)
    }
}

public 
Primary(id)
{
    new 
primarymenu menu_create("Primary Weapons""item_select")
    for(new 
0g_itemsi++)
    {
        new 
text[128]
        new 
codeboxtext[] = {"*CODE BOX*"}
        
        if(
item_data[i][category] != 0) return;

        if(
item_data[i][limit])
        {    
            
formatex(textcharsmax(text), "[ZTH] %s (%d/%d) %s%d"item_data[i][name], item_data[i][limit_type] ? item_data[i][limit_round] : item_data[i][limit_map], item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        }
        else  
formatex(textcharsmax(text), "[ZTH] %s %s%d"item_data[i][name],item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        
        
menu_additem(primarymenutext)
    }
}

public 
Pistol(id)
{
    new 
secondarymenu menu_create("secondary Weapons""item_select")
    for(new 
0g_itemsi++)
    {
        new 
text[128]
        new 
codeboxtext[] = {"*CODE BOX*"}
        
        if(
item_data[i][category] != 1) return;

        if(
item_data[i][limit])
        {    
            
formatex(textcharsmax(text), "[ZTH] %s (%d/%d) %s%d"item_data[i][name], item_data[i][limit_type] ? item_data[i][limit_round] : item_data[i][limit_map], item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        }
        else  
formatex(textcharsmax(text), "[ZTH] %s %s%d"item_data[i][name],item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        
        
menu_additem(secondarymenutext)
    }
}

public 
Meele(id)
{
    new 
meelemenu menu_create("Meele Weapons""item_select")
    for(new 
0g_itemsi++)
    {
        new 
text[128]
        new 
codeboxtext[] = {"*CODE BOX*"}
        
        if(
item_data[i][category] != 2) return;

        if(
item_data[i][limit])
        {    
            
formatex(textcharsmax(text), "[ZTH] %s (%d/%d) %s%d"item_data[i][name], item_data[i][limit_type] ? item_data[i][limit_round] : item_data[i][limit_map], item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        }
        else  
formatex(textcharsmax(text), "[ZTH] %s %s%d"item_data[i][name],item_data[i][codeb] ? codeboxtext[0] : item_data[i][cost])
        
        
menu_additem(meelemenutext)
    }
}

public 
item_select(id)
{
    new 
item_meeleitem_primaryitem_secondary

    
switch(item_primary)
    {
        default:{
            
weaponsMenu(id)
        }
    }
    
    switch(
item_secondary)
    {
        default:{ 
            
weaponsMenu(id)
        }
    }
    
    switch(
item_meele)
    {
        default:{
            
weaponsMenu(id)
        }
    }
}

public 
Recive(id)
{
    new 
item_secondaryitem_primaryitem_meele
    
new g_iRet

    ExecuteForward
(fw_selectedg_iRetitem_primary)
    
ExecuteForward(fw_selectedg_iRetitem_secondary)
    
ExecuteForward(fw_selectedg_iRetitem_meele)


Last edited by AnimalMonster; 11-12-2020 at 08:15.
AnimalMonster is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-12-2020 , 10:14   Re: Register_menu_item native
Reply With Quote #8

I was think you wanna to know how to register an item for zp menu

Try:
PHP Code:
#include <amxmodx>
#include <fun>

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

native register_item(item_nameitem_costitem_limititem_categorylimit_maxbool:limitonbool:codeboxbool:limit_roundd)
forward item_recive(iditem_secondaryitem_primaryitem_meele)

new const 
item_name[] = { "Deagle" }
const 
item_limit 3
const item_category 1
const limit_max 3
const bool:limiton 3
const bool:codebox 3
const bool:limit_roundd 3


new ItemID;
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
ItemID register_item(item_nameitem_costitem_limititem_categorylimit_maxlimitoncodeboxlimit_roundd)

}

public 
item_recive(iditem_secondaryitem_primaryitem_meele)
{
    if ( 
item_secondary == ItemID)
    {
        
give_item(id"weapon_deagle")
        new 
Player[32]
        
get_user_name(id Playercharsmax(Player) )
        
        
client_print0print_chat"[ZP] %s just bought %s",  Playeritem_name)
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 11-12-2020 at 13:31.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-14-2020 , 21:00   Re: Register_menu_item native
Reply With Quote #9

dam stop talking with codes and maybe try to understand eachother with words since that's why languages were made so people can understand eachother. jeeeeez.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode