MENU DE ARMAS SOLO ADMINS
#1
Bombilla 
Menu PREGAMER Solo para Admins

Definición : Este Menú fue echo para que los admin Puedan comprar armas Que no son de su Respectivo Equipo o están Restringidas por el Servidor

Modo de uso : Solo Presiona la N y el Menú se Abre.

Código PHP:
/*
   | INFORMACIÓN |

    Este PLUGIN ha sido creado por Kevin

======================================
<==|Incluides|==>
=====================================*/
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fun >

/*============================
<|==|Informacion del Plug|==>|
=============================*/

new MenuPlugin [  ] = { "Linake""1.0" "Kevin" }
/*
============
<==|Tag|==>|
============*/
new TAG [ ] = "GS"
/*=============
<|==|INIT|==>|
==============*/
public plugin_init (  ){
    
register_plugin MenuPlugin ], MenuPlugin ], MenuPlugin ])
    
register_clcmd ("nightvision""restriccion" )
}
/*=============
<|==|ENUM|==>|
==============*/
enum _:DATA_ADMIN {  NOMBRES 20 ], PRECIO,MDL_CSW,WEAPON 12 ] }
/*=============
<|==|Const|==>|
==============*/

new MenuPregamer [  ] [ DATA_ADMIN ] = { {"COMPRAR M4A1"3000CSW_M4A1"weapon_m4a1" }, {"COMPRAR AK47"3000CSW_AK47"weapon_ak47" },{"COMPRAR AWP"10000CSW_AWP"weapon_awp" }}
/*
===================
<==|Restrccion|==>|
===================*/

public restriccion(id)
{
    if (
get_user_flags(id) & ADMIN_BAN
        
Menu_Privilegiosid 
    else 
        
client_print(idprint_center"Error-Menu Tu no eres Admin")  
}
/*
===============
<==|Menu|==>|
==============*/

public Menu_Privilegiosid ) {
    new 
imenutext 100 ]
    
menu menu_create "\r.::\y[ \wMENU DE ARMAS \y]\r::.\r.::\y[\w SOLO ADMINS \y]\r::.""Poronga")
    
    for ( 
0sizeof MenuPregamer ); i++) {
        if ( 
cs_get_user_money id ) < MenuPregamer ] [ PRECIO ] ) {
            
formatex textcharsmaxtext ), "\d%s \r[ $%d ]",  MenuPregamer ] [ NOMBRES ], MenuPregamer ] [ PRECIO ] )
        } else {
            
formatex textcharsmaxtext ), "\w%s \y[ $%d ]",   MenuPregamer ] [ NOMBRES ], MenuPregamer ] [ PRECIO ] )
        }
        
menu_additem(menutext__menu_makecallback ("venta_callback") )
    }
    
menu_display(idmenu)
}
public 
venta_callback idmenuitem ) {
    if ( 
cs_get_user_money id ) < MenuPregamer item ] [ PRECIO ] )
        return 
ITEM_DISABLED;
    
    return 
ITEM_ENABLED;
}
public 
Poronga(idmenuitem) {
    if( 
item == MENU_EXIT )
        return 
PLUGIN_HANDLED;
/*===============================
<|==|Configuracion Del Menu|==>|
================================*/
    
drop_weapons id
    
give_item(idMenuPregamer item ] [ WEAPON ])
    
cs_set_user_bpammo(idMenuPregamer item ] [ MDL_CSW ], 150)
    
cs_set_user_money(idcs_get_user_money(id) - MenuPregamer item ] [ PRECIO ], )
    
chatcolor(id"!g.::!y[!team%s!y]!g::. !teamCompraste una !g: !y%s."TAG MenuPregamer item ] [ NOMBRES ] )
    return 
PLUGIN_HANDLED;

/*
======================================
<==|Stocsk Para Dropear las Armas|==>
=====================================*/
stock drop_weaponsiddropwhat)
{
    static 
weapons32 ], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)
    
    const 
PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|
    (
1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
    
    for (
0numi++)
    {
        
weaponid weapons[i]
        
        if (
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }
}
/*
==========================
<==|Stocsk ChatColor|==>|
==========================*/
stock chatcolorid, const input[], any:...)
{
    static 
szMsg[191], msgSayText;
    
    if (!
msgSayText)
        
msgSayText get_user_msgid("SayText");
    
    
vformat(szMsg190input3);

    
replace_all(szMsg190"!g""^4");
    
replace_all(szMsg190"!y""^1");
    
replace_all(szMsg190"!team""^3");
    
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    
write_byte(id id 33);
    
write_string(szMsg);
    
message_end();


Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#2
Veo porciones de códigos de muchos usuarios de acá y no tienen créditos (?)

Código PHP:
new MenuPregamer [  ] [ DATA_ADMIN ] = { {"COMPRAR M4A1"3000CSW_M4A1"weapon_m4a1" }, {"COMPRAR AK47"3000CSW_AK47"weapon_ak47" },{"COMPRAR AWP"10000CSW_AWP"weapon_awp" }}
->
new const MenuPregamer [  ] [ DATA_ADMIN ] = { {"COMPRAR M4A1"3000CSW_M4A1"weapon_m4a1" }, {"COMPRAR AK47"3000CSW_AK47"weapon_ak47" },{"COMPRAR AWP"10000CSW_AWP"weapon_awp" }} 

Y no queda muy bien hacerlo todo pegado a eso
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#3
(02/11/2018, 02:29 PM)Hypnotize escribió: Veo porciones de códigos de muchos usuarios de acá y no tienen créditos (?)

Código PHP:
new MenuPregamer [  ] [ DATA_ADMIN ] = { {"COMPRAR M4A1"3000CSW_M4A1"weapon_m4a1" }, {"COMPRAR AK47"3000CSW_AK47"weapon_ak47" },{"COMPRAR AWP"10000CSW_AWP"weapon_awp" }}
->
new const MenuPregamer [  ] [ DATA_ADMIN ] = { {"COMPRAR M4A1"3000CSW_M4A1"weapon_m4a1" }, {"COMPRAR AK47"3000CSW_AK47"weapon_ak47" },{"COMPRAR AWP"10000CSW_AWP"weapon_awp" }} 

Y no queda muy bien hacerlo todo pegado a eso

Mira la ultima respuesta que puse cuando pedi ayuda para optimizarlo .
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#4
y si no quiero que tenga precio cada arma? solo hacer el menu para admin con las skins de armas personalizadas, y ya
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)