Glow Plugin by Trajko [With Menu] ***UPDATED***

Started by GoldenNinja
8 Aug 2019, 13:33
Page 1 of 1
8 Aug 2019, 13:33(edited 19 Feb 2020, 17:12)

Hey everybody, I've made a plugin that makes your character glow in a color you choose, command for opening the menu is /glow and it has 13 colors available ( blue, green, red, purple, pink, white, silver, cyan, lime, brown, tan, yellow, orange. )
!!!You need AMXModX for this plugin!!!
https://www.sendspace.com/file/tbut5x
Thanks to Menko for Support, JocA and juice for coding problems, and thanks to ChiChiN and xinc for helping me test the plugin, hope you people will enjoy it, and give me some feedback about it if you use it!

8 Aug 2019, 21:06

Good job Trajko! Nice to see you trying development, do you have the source code so we can take a look at it?

8 Aug 2019, 22:06

no .sma :(

8 Aug 2019, 22:42

Ha, so you added menu XD, you had enough "classic"?

P. S
Still no black...

9 Aug 2019, 12:08

For sma contact me in private, steam/discord guys :D

9 Aug 2019, 13:15

Post it on pastebin.com bro and repost it here, its not like you made something inovative, be real (you can get the code with 1min googling) :D #dont #be #offended #just #honest #opinion

9 Aug 2019, 13:54(edited 9 Aug 2019, 16:51)

#include
#include
#include


public plugin_init()
{

register_clcmd( "say /glow", "GlowMenu" );

}

public GlowMenu( id )
{

new menu = menu_create( "\rGlow Menu v1.0 by Trajko:", "menu_handler" );

menu_additem( menu, "\wGLOW BLUE", "", 0 );
menu_additem( menu, "\wGLOW GREEN", "", 0 );
menu_additem( menu, "\wGLOW RED", "", 0);
menu_additem( menu, "\wGLOW PURPLE", "", 0);
menu_additem( menu, "\wGLOW PINK", "", 0);
menu_additem( menu, "\wGLOW WHITE", "", 0);
menu_additem( menu, "\wGLOW SILVER", "", 0);
menu_additem( menu, "\wGLOW CYAN", "", 0);
menu_additem( menu, "\wGLOW LIME", "", 0);
menu_additem( menu, "\wGLOW BROWN", "", 0);
menu_additem( menu, "\wGLOW TAN", "", 0);
menu_additem( menu, "\wGLOW YELLOW", "", 0);
menu_additem( menu, "\wGLOW ORANGE", "", 0);
menu_additem( menu, "\wNO GLOW", "", 0);



menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

menu_display( id, menu, 0 );

}

public menu_handler( id, menu, item )

{

switch( item )

{
case 0:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing blue^3" )
GlowMenu( id )
}
case 1:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing green^3")
GlowMenu( id )
}
case 2:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing red^3")
GlowMenu( id )
}
case 3:
{
set_user_rendering(id, kRenderFxGlowShell, 128, 0, 128, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing purple^3")
GlowMenu( id )
}
case 4:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 105, 180, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing pink^3")
GlowMenu( id )
}
case 5:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing white^3")
GlowMenu( id )
}
case 6:
{
set_user_rendering(id, kRenderFxGlowShell, 192, 192, 192, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing silver^3")
GlowMenu( id )
}
case 7:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing cyan^3")
GlowMenu( id )
}
case 8:
{
set_user_rendering(id, kRenderFxGlowShell, 124, 252, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing lime^3")
GlowMenu( id )
}
case 9:
{
set_user_rendering(id, kRenderFxGlowShell, 139, 69, 19, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing brown^3")
GlowMenu( id )
}
case 10:
{
set_user_rendering(id, kRenderFxGlowShell, 210, 180, 140, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing tan^3")
GlowMenu( id )
}
case 11:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing yellow^3")
GlowMenu( id )
}
case 12:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 165, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing orange^3")
GlowMenu( id )
}
case 13:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are not glowing anymore^3")
GlowMenu( id )
menu_destroy( menu );
}
case MENU_EXIT:
{
ColorChat(id, GREEN, "You have closed the menu^3")
menu_destroy( menu );
}

}
menu_destroy( menu );
return PLUGIN_HANDLED;
}

9 Aug 2019, 14:36

Cool, just add menu_destroy in MENU_EXIT to avoid possible problems

9 Aug 2019, 15:06

Definitly add menu_destroy(menu) so you can release the memory resource. Good thing is Pawn doesn't have heap allocation so memory leaks are way harder to generate.

Do you enjoy coding such plugins? Also, think of uploading your source code to a public code hosting platform like GitHub, it could be a great way to show your projects in the future, especially for professional purposes!

9 Aug 2019, 15:06(edited 9 Aug 2019, 16:47)

Allright, here is the updated plugin and .sma , i really hope nothing else to changeeee!
https://www.sendspace.com/file/6hc3be
*sma is also in the .rar folder, but here for case it gets lost*
#include
#include
#include


public plugin_init()
{

register_clcmd( "say /glow", "GlowMenu" );

}

public GlowMenu( id )
{

new menu = menu_create( "\rGlow Menu v1.0 by Trajko:", "menu_handler" );

menu_additem( menu, "\wGLOW BLUE", "", 0 );
menu_additem( menu, "\wGLOW GREEN", "", 0 );
menu_additem( menu, "\wGLOW RED", "", 0);
menu_additem( menu, "\wGLOW PURPLE", "", 0);
menu_additem( menu, "\wGLOW PINK", "", 0);
menu_additem( menu, "\wGLOW WHITE", "", 0);
menu_additem( menu, "\wGLOW SILVER", "", 0);
menu_additem( menu, "\wGLOW CYAN", "", 0);
menu_additem( menu, "\wGLOW LIME", "", 0);
menu_additem( menu, "\wGLOW BROWN", "", 0);
menu_additem( menu, "\wGLOW TAN", "", 0);
menu_additem( menu, "\wGLOW YELLOW", "", 0);
menu_additem( menu, "\wGLOW ORANGE", "", 0);
menu_additem( menu, "\wNO GLOW", "", 0);



menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

menu_display( id, menu, 0 );

}

public menu_handler( id, menu, item )

{

switch( item )

{
case 0:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing blue^3" )
GlowMenu( id )
}
case 1:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing green^3")
GlowMenu( id )
}
case 2:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing red^3")
GlowMenu( id )
}
case 3:
{
set_user_rendering(id, kRenderFxGlowShell, 128, 0, 128, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing purple^3")
GlowMenu( id )
}
case 4:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 105, 180, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing pink^3")
GlowMenu( id )
}
case 5:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing white^3")
GlowMenu( id )
}
case 6:
{
set_user_rendering(id, kRenderFxGlowShell, 192, 192, 192, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing silver^3")
GlowMenu( id )
}
case 7:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing cyan^3")
GlowMenu( id )
}
case 8:
{
set_user_rendering(id, kRenderFxGlowShell, 124, 252, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing lime^3")
GlowMenu( id )
}
case 9:
{
set_user_rendering(id, kRenderFxGlowShell, 139, 69, 19, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing brown^3")
GlowMenu( id )
}
case 10:
{
set_user_rendering(id, kRenderFxGlowShell, 210, 180, 140, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing tan^3")
GlowMenu( id )
}
case 11:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing yellow^3")
GlowMenu( id )
}
case 12:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 165, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing orange^3")
GlowMenu( id )
}
case 13:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are not glowing anymore^3")
GlowMenu( id )
menu_destroy( menu );
}
case MENU_EXIT:
{
ColorChat(id, GREEN, "You have closed the menu^3")
menu_destroy( menu );
}

}
menu_destroy( menu );
return PLUGIN_HANDLED;
}

9 Aug 2019, 16:29

menu_destroy(menu) has to be put right before "return PLUGIN_HANDLED;", so that in any case you release the memory resource :

      [...]

case MENU_EXIT: {
ColorChat(id, GREEN, "You have closed the menu^3")
}

}

menu_destroy( menu );
return PLUGIN_HANDLED;
}

9 Aug 2019, 16:47

Done! :p

19 Feb 2020, 17:11

https://www.sendspace.com/file/tbut5x
I updated pink color and silver slightly :P
#include
#include
#include


public plugin_init()
{

register_clcmd( "say /glow", "GlowMenu" );

}

public GlowMenu( id )
{

new menu = menu_create( "\rGlow Menu v1.0 by Trajko:", "menu_handler" );

menu_additem( menu, "\wGLOW BLUE", "", 0 );
menu_additem( menu, "\wGLOW GREEN", "", 0 );
menu_additem( menu, "\wGLOW RED", "", 0);
menu_additem( menu, "\wGLOW PURPLE", "", 0);
menu_additem( menu, "\wGLOW PINK", "", 0);
menu_additem( menu, "\wGLOW WHITE", "", 0);
menu_additem( menu, "\wGLOW SILVER", "", 0);
menu_additem( menu, "\wGLOW CYAN", "", 0);
menu_additem( menu, "\wGLOW LIME", "", 0);
menu_additem( menu, "\wGLOW BROWN", "", 0);
menu_additem( menu, "\wGLOW TAN", "", 0);
menu_additem( menu, "\wGLOW YELLOW", "", 0);
menu_additem( menu, "\wGLOW ORANGE", "", 0);
menu_additem( menu, "\wNO GLOW", "", 0);



menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

menu_display( id, menu, 0 );

}

public menu_handler( id, menu, item )

{

switch( item )

{
case 0:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing blue^3" )
GlowMenu( id )
}
case 1:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing green^3")
GlowMenu( id )
}
case 2:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing red^3")
GlowMenu( id )
}
case 3:
{
set_user_rendering(id, kRenderFxGlowShell, 128, 0, 128, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing purple^3")
GlowMenu( id )
}
case 4:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 20, 147, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing pink^3")
GlowMenu( id )
}
case 5:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing white^3")
GlowMenu( id )
}
case 6:
{
set_user_rendering(id, kRenderFxGlowShell, 128, 128, 128, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing silver^3")
GlowMenu( id )
}
case 7:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing cyan^3")
GlowMenu( id )
}
case 8:
{
set_user_rendering(id, kRenderFxGlowShell, 124, 252, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing lime^3")
GlowMenu( id )
}
case 9:
{
set_user_rendering(id, kRenderFxGlowShell, 139, 69, 19, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing brown^3")
GlowMenu( id )
}
case 10:
{
set_user_rendering(id, kRenderFxGlowShell, 210, 180, 140, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing tan^3")
GlowMenu( id )
}
case 11:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing yellow^3")
GlowMenu( id )
}
case 12:
{
set_user_rendering(id, kRenderFxGlowShell, 255, 165, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are now glowing orange^3")
GlowMenu( id )
}
case 13:
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25)
ColorChat(id, GREEN, "You are not glowing anymore^3")
GlowMenu( id )
menu_destroy( menu );
}
case MENU_EXIT:
{
ColorChat(id, GREEN, "You have closed the menu^3")
menu_destroy( menu );
}

}
menu_destroy( menu );
return PLUGIN_HANDLED;
}

Page 1 of 1

Reply

Please log in to post replies.