25/10/2013, 02:32 PM
Aquí les traigo un menú de entrenamiento así puedan practicar en sus servidores saltos o algún modo que tengan. Espero que les sirva.
Si se pueden codear mejor o de otro modo por favor comenten ;D
Código:
#include < amxmodx >
#include < fakemeta >
#include < fakemeta_util >
new const iPlugin[] = "Entrenamiento";
new const iVersion[] = "0.1.0";
new const iAutor[] = "Palber";
public plugin_init()
{
register_plugin( iPlugin, iVersion, iAutor );
register_clcmd( "say /entrenar", "show_entrenar" );
}
new const gArmasName[][] =
{
"Usp",
"Glock",
"Five Seven",
"Deagle",
"TMP",
"Ak-47",
"M4a1",
"M3",
"XM1014",
"Aug",
"Elite",
"AWP",
"Famas",
"G3SG1",
"Gali",
"Galil",
"Scout",
"M249",
"Mac 10",
"MP5 Navy",
"P228",
"SG550",
"SG552",
"UMP 45"
}
new const gArmasEntity[][] =
{
"weapon_usp",
"weapon_glock18",
"weapon_fiveseven",
"weapon_deagle",
"weapon_tmp",
"weapon_ak47",
"weapon_m4a1",
"weapon_m3",
"weapom_xm1014",
"weapon_aug",
"weapon_elite",
"weapon_awp",
"weapon_famas",
"weapon_g3sg1",
"weapon_gali",
"weapon_galil",
"weapon_scout",
"weapon_m249",
"weapon_mac10",
"weapon_mp5navy",
"weapon_p228",
"weapon_p90",
"weapon_sg550",
"weapon_sg552",
"weapon_ump45"
}
new gCheckPoints[ 33 ];
new gGoCheck[ 33 ];
new Float:gGoPoint[ 3 ];
public show_entrenar( id )
{
static szMenu[ 100 ], iMenu;
iMenu = menu_create( "Menu de entrenamiento", "handler_entrenar" );
formatex( szMenu, charsmax( szMenu ), "\wCheckPoint: \y#%d", gCheckPoints[ id ] );
menu_additem( iMenu, szMenu, "0" );
formatex( szMenu, charsmax( szMenu ), "\wGoCheck: \y#%d^n", gGoCheck[ id ] );
menu_additem( iMenu, szMenu, "1" );
menu_additem( iMenu, "Armas", "2" );
menu_additem( iMenu, "Resetear", "3" );
menu_setprop( iMenu, MPROP_EXITNAME, "Salir" );
menu_display( id, iMenu );
}
public handler_entrenar( id, menu, seleccion )
{
switch( seleccion )
{
case MENU_EXIT: return;
case 0: {
gCheckPoints[ id ]++;
pev( id, pev_origin, gGoPoint );
}
case 1: {
if( !gCheckPoints[ id ] ) {
show_entrenar( id );
return;
}
gGoCheck[ id ]++;
set_pev( id, pev_velocity, Float:{ 0.0, 0.0, 0.0 } );
set_pev( id, pev_origin, gGoPoint );
}
case 2: { show_armas( id ); return; }
case 3: {
gCheckPoints[ id ] = 0;
gGoCheck[ id ] = 0;
}
}
show_entrenar( id );
}
public show_armas( id )
{
static szMenu[ 100 ], iMenu;
iMenu = menu_create( "Menu de armas", "handler_armas" );
for( new i; i < sizeof gArmasName; i++ )
{
formatex( szMenu, charsmax( szMenu ), "%s", gArmasName[ i ] );
menu_additem( iMenu, szMenu );
}
menu_setprop( iMenu, MPROP_BACKNAME, "Atras" );
menu_setprop( iMenu, MPROP_NEXTNAME, "Siguiente" );
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_display( id, iMenu );
}
public handler_armas( id, menu, seleccion )
{
fm_give_item( id, gArmasEntity[ seleccion ] );
show_entrenar( id );
return;
}
Si se pueden codear mejor o de otro modo por favor comenten ;D