02/11/2018, 01:19 AM
(Última modificación: 02/11/2018, 01:31 AM por KevinJesus.)
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.
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 [ 0 ], MenuPlugin [ 1 ], MenuPlugin [ 2 ])
register_clcmd ("nightvision", "restriccion" )
}
/*=============
<|==|ENUM|==>|
==============*/
enum _:DATA_ADMIN { NOMBRES [ 20 ], PRECIO,MDL_CSW,WEAPON [ 12 ] }
/*=============
<|==|Const|==>|
==============*/
new MenuPregamer [ ] [ DATA_ADMIN ] = { {"COMPRAR M4A1", 3000, CSW_M4A1, "weapon_m4a1" }, {"COMPRAR AK47", 3000, CSW_AK47, "weapon_ak47" },{"COMPRAR AWP", 10000, CSW_AWP, "weapon_awp" }}
/*
===================
<==|Restrccion|==>|
===================*/
public restriccion(id)
{
if (get_user_flags(id) & ADMIN_BAN)
Menu_Privilegios( id )
else
client_print(id, print_center, "Error-Menu Tu no eres Admin")
}
/*
===============
<==|Menu|==>|
==============*/
public Menu_Privilegios( id ) {
new i, menu, text [ 100 ]
menu = menu_create ( "\r.::\y[ \wMENU DE ARMAS \y]\r::.\r.::\y[\w SOLO ADMINS \y]\r::.", "Poronga")
for ( i = 0; i < sizeof ( MenuPregamer ); i++) {
if ( cs_get_user_money ( id ) < MenuPregamer [ i ] [ PRECIO ] ) {
formatex ( text, charsmax( text ), "\d%s \r[ $%d ]", MenuPregamer [ i ] [ NOMBRES ], MenuPregamer [ i ] [ PRECIO ] )
} else {
formatex ( text, charsmax( text ), "\w%s \y[ $%d ]", MenuPregamer [ i ] [ NOMBRES ], MenuPregamer [ i ] [ PRECIO ] )
}
menu_additem(menu, text, _, _, menu_makecallback ("venta_callback") )
}
menu_display(id, menu)
}
public venta_callback ( id, menu, item ) {
if ( cs_get_user_money ( id ) < MenuPregamer [ item ] [ PRECIO ] )
return ITEM_DISABLED;
return ITEM_ENABLED;
}
public Poronga(id, menu, item) {
if( item == MENU_EXIT )
return PLUGIN_HANDLED;
/*===============================
<|==|Configuracion Del Menu|==>|
================================*/
drop_weapons ( id, 1 )
give_item(id, MenuPregamer [ item ] [ WEAPON ])
cs_set_user_bpammo(id, MenuPregamer [ item ] [ MDL_CSW ], 150)
cs_set_user_money(id, cs_get_user_money(id) - MenuPregamer [ item ] [ PRECIO ], 1 )
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_weapons( id, dropwhat)
{
static weapons[ 32 ], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
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 (i = 0; i < num; i++)
{
weaponid = weapons[i]
if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
{
static wname[32]
get_weaponname(weaponid, wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
/*
==========================
<==|Stocsk ChatColor|==>|
==========================*/
stock chatcolor( id, const input[], any:...)
{
static szMsg[191], msgSayText;
if (!msgSayText)
msgSayText = get_user_msgid("SayText");
vformat(szMsg, 190, input, 3);
replace_all(szMsg, 190, "!g", "^4");
replace_all(szMsg, 190, "!y", "^1");
replace_all(szMsg, 190, "!team", "^3");
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgSayText, .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.