24/11/2018, 01:22 AM
(Última modificación: 08/06/2019, 10:41 AM por Alejandro. Edited 4 times in total.)
Simple screen fade, con menu y diferentes colores como opcion
PD: SIMPLE
PD: SIMPLE
Código PHP:
/* Kill Fade MDSIGN */
#include <amxmodx>
#include <fvault>
new gz_Plugin [ ] [ ] = { "KillFade Menu", "v1.0", "|Alejandro-." }
new guardar_datos [ ] = "ColorSelecionado";
public plugin_init()
{
register_plugin(gz_Plugin [ 0 ], gz_Plugin [ 1 ], gz_Plugin [ 2 ])
register_clcmd("say /screen", "Menu_Screen")
register_event( "DeathMsg", "DeathMsg", "a" );
}
enum _:Data_Color
{
Name [ 32 ],
red,
green,
blue
}
new gz_Colores [ ] [Data_Color] =
{
{ "Blanco", 255, 255, 255 },
{ "Negro", 0, 0, 0 },
{ "Amarillo", 255, 255, 0 },
{ "Rojo", 255, 0, 0 },
{ "Verde", 0, 255, 0 }
}
new g_select [ 33 ];
public DeathMsg()
{
new Atacante = read_data(1);
/* \\\ S C R E E N F A D E /// */
if(!is_user_alive(Atacante)) return PLUGIN_HANDLED;
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Atacante)
write_short(1 << 12)
write_short(1 << 12)
write_short(0x0000)
write_byte(gz_Colores [ g_select [ Atacante ] ] [red]) //rojo
write_byte(gz_Colores [ g_select [ Atacante ] ] [green]) //verde
write_byte(gz_Colores [ g_select [ Atacante ] ] [blue]) //azul
write_byte(100)
message_end()
return PLUGIN_HANDLED;
/* \\\ S C R E E N F A D E /// */
}
/* \\\ M E N U /// */
public Menu_Screen (id) {
new menu, Select [ 200 ];
menu = menu_create("\wScrenn Fade^nBy: |Alejandro-.", "Items")
for(new i = 0; i < sizeof gz_Colores; i++) {
if( g_select[ id ] == i )
{
formatex( Select, charsmax(Select), "\w%s \r[ \yACTUAL \r]", gz_Colores [ i ] [Name] );
menu_additem( menu, Select);
}
else menu_additem(menu, gz_Colores [ i ] [Name])
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public Items(id, menu, item) {
if ( item == MENU_EXIT ) {
menu_destroy( menu )
return PLUGIN_HANDLED;
}
if( g_select [ id ] == item )
{
client_print( id, print_center, "* Ya elegiste este color *");
return PLUGIN_HANDLED;
}
g_select [ id ] = item;
return PLUGIN_HANDLED;
}
/* \\\ M E N U /// */
/* \\\ G U A R D A D O /// */
vault_guardar_datos(id)
{
new data[4]; formatex(data, charsmax(data), "%d", g_select[id]) // ponemos sus puntos en un string
new iName[33]; get_user_name(id, iName, charsmax(iName)) //obtenemos su nombre y lo almacenamos en iName
fvault_set_data(guardar_datos, iName, data) // Guardamos el nombre y los dato de la variable creada (vault_variable)
}
vault_cargar_datos(id)
{
new data[4], iName[33]; get_user_name(id, iName, charsmax(iName))
if(fvault_get_data(guardar_datos, iName, data, charsmax(data)))
g_select[id] = str_to_num(data)
}
public client_putinserver(id)
{
g_select [ id ] = 0
vault_cargar_datos(id)
}
public client_disconnect(id)
{
vault_guardar_datos(id)
}