Menu de Brillo (SIMPLE)
#1
Que tal amigos, espero se encuentren bien, les voy a traer uno de los muchos plugins que hice durante mi baneo. Y por favor antes que nada quiero decir que se ahorren sus comentarios que no aportan nada bueno a este foro, tampoco quiero que me digan que he hecho copy-paste porque no lo he hecho Whatever así que... Cualquier comentario negativo y nada que ver ps ni lo voy a contestar Roflmao

Este menú de brillo fue uno de los primeros plugins que hice aprendiendo a programar y toda esa verga, es simple, capaz les sirve para algún mod que tengan o quien sabe? Si ven algo in-necesario o algo que no este muy bien hecho me lo dicen! Créditos a totopizza que me dijo lo del item-1 Roflmao

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cc>

#define PLUGIN "Simple Glow Menu"
#define VERSION "1.0"
#define AUTHOR "Nazy.-"

#define GlowAmount 20 
// Definimos el grosor del glow, mientras mas sea el numero, mas fuerte sera el glow

enum _:DATA_GLOW
{
    
NOMBRE[32],
    
COLOR_R,
    
COLOR_G,
    
COLOR_B
}

new const 
GlowLista[][DATA_GLOW] = 
{
    
/* Nombre  - R  - G  - B */
    
"Blanco"255255255},
    { 
"Verde"025510},
    { 
"Rojo"255100},
    { 
"Rosado"2000200 },
    { 
"Verde Slime"66245147 },
    { 
"Azul Mar"66156245 },
    { 
"Purpura"11166245 },
    { 
"Fuxia"24566123 },
    { 
"Rojo Sangre"2456666 },
    { 
"Arcilla"797161 },
    { 
"Verde Lima"14625569 }
}

new 
g_GlowSelected[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /glowmenu""cmd_glowmenu")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawnPost"1)
}
public 
cmd_glowmenu(id) {
    
    new 
menu menu_create("Menu de Glow""gm_handler")
    
    
menu_additem(menu"\yREMOVER BRILLO")
    
    for(new 
0sizeof(GlowLista); i++) menu_additem(menuGlowLista[i][NOMBRE]);
    
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}
public 
client_putinserver(idg_GlowSelected[id] =-1
public gm_handler(idmenuitem) {
    
    if(
item == 0) {
        if(!
g_GlowSelected[id]) colorChat(idprint_chat"!g[GLOW] !yTu no tienes un brillo seleccionado")
        
set_user_rendering(id)
        
colorChat(idprint_chat"!g[GLOW] !yTu brillo fue removido!")
    } else {
    
    if(
is_user_alive(id)) { 
        if(
g_GlowSelected[id] == item-1) return PLUGIN_HANDLED;
                
        
g_GlowSelected[id] = item-1
        set_user_rendering
(idkRenderFxGlowShellGlowLista[item-1][COLOR_R], GlowLista[item-1][COLOR_G], GlowLista[item-1][COLOR_B], kRenderNormalGlowAmount)
        
colorChat(idprint_chat"!g[GLOW] !yHas elegido el color !g%s!y!"GlowLista[item-1][NOMBRE])
    }
}
    return 
PLUGIN_HANDLED;
}
public 
fw_PlayerSpawnPost(id) {
    if(
g_GlowSelected[id] == -1
        return 
PLUGIN_HANDLED
        
    
else if(g_GlowSelected[id])
        
set_user_rendering(idkRenderFxGlowShellGlowLista[g_GlowSelected[id]][COLOR_R], GlowLista[g_GlowSelected[id]][COLOR_G], GlowLista[g_GlowSelected[id]][COLOR_B], kRenderNormalGlowAmount)
        
    return 
PLUGIN_HANDLED;


Si no les compila copiando el código por algún motivo, yo utilizo AMXMODX 1.8.1-300

Otra cosa, el código se ve re mal tabulado pero es el foro porque yo en mi amxmod-studio lo tengo tabulado normal ._.


Archivos adjuntos
.sma   Descargar AMXX / MenuGlow.sma (Tamaño: 2.31 KB / Descargas: 1)
Responder
#2
GJ. Whatever
Responder
#3
Versión tu vieja

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Simple Glow Menu"
#define VERSION "1.0"
#define AUTHOR "tu vieja"

// Definimos el grosor del glow, mientras mas sea el numero, mas fuerte sera el glow
#define GlowAmount 20 

enum _:DATA_GLOW
{
    
NOMBRE[32],
    
COLOR_R,
    
COLOR_G,
    
COLOR_B
}

new const 
GlowLista[][DATA_GLOW] = 
{
    
/* Nombre              - R    - G     - B */
    
"Blanco",         255255255},
    { 
"Verde",             025510},
    { 
"Rojo",             255100},
    { 
"Rosado",         2000200 },
    { 
"Verde Slime",     66245147 },
    { 
"Azul Mar",         66156245 },
    { 
"Purpura",         11166245 },
    { 
"Fuxia",             24566123 },
    { 
"Rojo Sangre",     2456666 },
    { 
"Arcilla",         797161 },
    { 
"Verde Lima",     14625569 }
}

new 
g_GlowSelected[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /glowmenu""ClCmd_GlowMenu")
    
RegisterHam(Ham_Spawn"player""OnPlayer_Spawn_Post"true)
}

public 
client_putinserver(id
{
    
g_GlowSelected[id] = -1
}

public 
ClCmd_GlowMenu(id
{
    new 
menu menu_create("Menu de Glow""GlowMenuHandler")
    
    
menu_additem(menu"\yRemover Brillo^n")
    
    for(new 
0sizeof(GlowLista); i++) 
        
menu_additem(menuGlowLista[i][NOMBRE]);
    
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}

public 
GlowMenuHandler(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED;
    }
    
    if(
item == 0
    {
        if(
g_GlowSelected[id] < 0
        {
            
client_print_color(idprint_team_default"^4[GLOW]^1 Tu no tienes un brillo seleccionado")
            
            
menu_display(idmenu0)
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
g_GlowSelected[id] = -1
            client_print_color
(idprint_team_default"^4[GLOW]^1 Tu brillo fue removido!")
            
            if(
is_user_alive(id)) // no le vas a cambiar el glow estando muerto, gil
                
ResetGlow(id)
        }
    } 
    else 
// se asume que los hay un item de slot 0 (primera opcion) y otro de rango [1 , sizeof(GlowLista)]
    
{
        
item -= // se corrige el offset
        
        
if(g_GlowSelected[id] == item)
        {
            
client_print_color(idprint_team_default"^4[GLOW]^1 Ya tienes este brillo")
            
menu_display(idmenu0// y mostrale el menu de nuevo, que pajero 
            
return PLUGIN_HANDLED
        
}
        else 
        {
            
g_GlowSelected[id] = item
            
            
if(is_user_alive(id)) 
            {
                
ResetGlow(id)
                
client_print_color(idprint_team_default"^4[GLOW]^1 Has elegido el color ^4%s^1"GlowLista[item][NOMBRE])
            }
            else
            {
                
client_print_color(idprint_team_default"^4[GLOW]^1 En tu proximo Spawn tendras el color ^4%s^1"GlowLista[item][NOMBRE])
            }
        }
    }
    
    
menu_destroy(menu// para corregir lindo memory leak, te spameo este comando y te rompo el server si no tienes esto
    
return PLUGIN_HANDLED;
}

public 
OnPlayer_Spawn_Post(id
{
    if(
is_user_alive(id)) 
        
ResetGlow(id)


ResetGlow(id)
{
    (
g_GlowSelected[id] > -1) ?
        
set_user_rendering(id
                            
kRenderFxGlowShell
                            
GlowLista[g_GlowSelected[id]][COLOR_R], 
                            
GlowLista[g_GlowSelected[id]][COLOR_G], 
                            
GlowLista[g_GlowSelected[id]][COLOR_B], 
                            
kRenderNormal
                            
GlowAmount) :
        
set_user_rendering(id) ;

Responder
#4
(19/05/2020, 04:05 PM)meTaLiCroSS escribió: Versión tu vieja

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Simple Glow Menu"
#define VERSION "1.0"
#define AUTHOR "tu vieja"

// Definimos el grosor del glow, mientras mas sea el numero, mas fuerte sera el glow
#define GlowAmount 20 

enum _:DATA_GLOW
{
 
NOMBRE[32],
 
COLOR_R,
 
COLOR_G,
 
COLOR_B
}

new const 
GlowLista[][DATA_GLOW] = 
{
 
/* Nombre  - R - G - B */
 
"Blanco"255255255},
 { 
"Verde"025510},
 { 
"Rojo"255100},
 { 
"Rosado"2000200 },
 { 
"Verde Slime"66245147 },
 { 
"Azul Mar"66156245 },
 { 
"Purpura"11166245 },
 { 
"Fuxia"24566123 },
 { 
"Rojo Sangre"2456666 },
 { 
"Arcilla"797161 },
 { 
"Verde Lima"14625569 }
}

new 
g_GlowSelected[33];

public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_clcmd("say /glowmenu""ClCmd_GlowMenu")
 
RegisterHam(Ham_Spawn"player""OnPlayer_Spawn_Post"true)
}

public 
client_putinserver(id
{
 
g_GlowSelected[id] = -1
}

public 
ClCmd_GlowMenu(id
{
 new 
menu menu_create("Menu de Glow""GlowMenuHandler")
 
 
menu_additem(menu"\yRemover Brillo^n")
 
 for(new 
0sizeof(GlowLista); i++) 
 
menu_additem(menuGlowLista[i][NOMBRE]);
 
 
menu_display(idmenu0)
 return 
PLUGIN_HANDLED;
}

public 
GlowMenuHandler(idmenuitem
{
 if(
item == MENU_EXIT)
 {
 
menu_destroy(menu)
 return 
PLUGIN_HANDLED;
 }
 
 if(
item == 0
 {
 if(
g_GlowSelected[id] < 0
 {
 
client_print_color(idprint_team_default"^4[GLOW]^1 Tu no tienes un brillo seleccionado")
 
 
menu_display(idmenu0)
 return 
PLUGIN_HANDLED
 
}
 else
 {
 
g_GlowSelected[id] = -1
 client_print_color
(idprint_team_default"^4[GLOW]^1 Tu brillo fue removido!")
 
 if(
is_user_alive(id)) // no le vas a cambiar el glow estando muerto, gil
 
ResetGlow(id)
 }
 } 
 else 
// se asume que los hay un item de slot 0 (primera opcion) y otro de rango [1 , sizeof(GlowLista)]
 
{
 
item -= // se corrige el offset
 
 
if(g_GlowSelected[id] == item)
 {
 
client_print_color(idprint_team_default"^4[GLOW]^1 Ya tienes este brillo")
 
menu_display(idmenu0// y mostrale el menu de nuevo, que pajero 
 
return PLUGIN_HANDLED
 
}
 else 
 {
 
g_GlowSelected[id] = item
 
 
if(is_user_alive(id)) 
 {
 
ResetGlow(id)
 
client_print_color(idprint_team_default"^4[GLOW]^1 Has elegido el color ^4%s^1"GlowLista[item][NOMBRE])
 }
 else
 {
 
client_print_color(idprint_team_default"^4[GLOW]^1 En tu proximo Spawn tendras el color ^4%s^1"GlowLista[item][NOMBRE])
 }
 }
 }
 
 
menu_destroy(menu// para corregir lindo memory leak, te spameo este comando y te rompo el server si no tienes esto
 
return PLUGIN_HANDLED;
}

public 
OnPlayer_Spawn_Post(id
{
 if(
is_user_alive(id)) 
 
ResetGlow(id)


ResetGlow(id)
{
 (
g_GlowSelected[id] > -1) ?
 
set_user_rendering(id
 
kRenderFxGlowShell
 
GlowLista[g_GlowSelected[id]][COLOR_R], 
 
GlowLista[g_GlowSelected[id]][COLOR_G], 
 
GlowLista[g_GlowSelected[id]][COLOR_B], 
 
kRenderNormal
 
GlowAmount) :
 
set_user_rendering(id) ;


mm... ¿Gracias? Supongo... Tu eres más avanzado que yo así que no puedes comparar... A ysi
Responder
#5
(19/05/2020, 04:09 PM)Nazy.- escribió: mm... ¿Gracias? Supongo... Tu eres más avanzado que yo así que no puedes comparar... A ysi

Quien está comparando
Responder
#6
Ya esta creado, si colocas un sistema de guardado de brillo te aplaudo pacman
Responder
#7
(22/05/2020, 09:57 AM)alexiways escribió: Ya esta creado, si colocas un sistema de guardado de brillo te aplaudo pacman

easy x adv vault
Responder
#8
hacelo :V
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)