Raised This Month: $51 Target: $400
 12% 

Can someone tell me how to add message in .sma file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mmiicchhaaeell
Member
Join Date: Oct 2020
Old 10-31-2020 , 20:06   Can someone tell me how to add message in .sma file?
Reply With Quote #1

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Vip GunMenu"
#define VERSION "1.0"
#define AUTHOR "SenaTor"

#define ADMIN_ACCESS ADMIN_ALL
new bool:imaC4[ 33 ];

new menu;

new cvar_second;

public plugin_init()
{
register_plugin("Gun Menu", "1.0", "26-{indra}")
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)

cvar_second = register_cvar("Show_Menu_seconds", "0.5")

}
public fw_PlayerSpawn_Post(id)
{
if (!is_user_alive(id))
return;

set_task(get_pcvar_float(cvar_second), "Vip_menu", id)
}

public Vip_menu(id)
{
if (!is_user_alive(id))
return

new flags = get_user_flags(id)

menu = menu_create("\r[\wW\rP \yGaming | \rWeapon \wMenu\r]", "VIP_handler")

-----------REQUESTED TEXT WOULD GO HERE-------------

if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)



if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wAK47 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wAK47 \y+ \wDeagle\r]", "", ADMIN_ACCESS)



if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wFAMAS \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wFAMAS \y+ \wDeagle\r]", "", ADMIN_ACCESS)




Above is just a partial script from .sma file.
I want to add message between the menu title "WP Gaming Weapon Menu" and the weapons list, like it shows with the arrow and blue line in this picture. That's Where I want to write this text: "Want Admin? Apply on Facebook"


Thanks!



Last edited by Mmiicchhaaeell; 10-31-2020 at 20:08. Reason: Picture
Mmiicchhaaeell is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 10-31-2020 , 21:21   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #2

You posted in the wrong forum as this is for SourceMod. You'll want to post here where there are more people with AMX Mod X experience.

Edit: A moderator kindly moved it.
__________________

Last edited by Psyk0tik; 10-31-2020 at 21:30.
Psyk0tik is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 10-31-2020 , 22:13   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #3

Quote:
Originally Posted by Mmiicchhaaeell View Post
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Vip GunMenu"
#define VERSION "1.0"
#define AUTHOR "SenaTor"

#define ADMIN_ACCESS ADMIN_ALL
new bool:imaC4[ 33 ];

new menu;

new cvar_second;

public plugin_init()
{
register_plugin("Gun Menu", "1.0", "26-{indra}")
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)

cvar_second = register_cvar("Show_Menu_seconds", "0.5")

}
public fw_PlayerSpawn_Post(id)
{
if (!is_user_alive(id))
return;

set_task(get_pcvar_float(cvar_second), "Vip_menu", id)
}

public Vip_menu(id)
{
if (!is_user_alive(id))
return

new flags = get_user_flags(id)

menu = menu_create("\r[\wW\rP \yGaming | \rWeapon \wMenu\r]", "VIP_handler")

-----------REQUESTED TEXT WOULD GO HERE-------------

if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)



if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wAK47 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wAK47 \y+ \wDeagle\r]", "", ADMIN_ACCESS)



if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wFAMAS \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wFAMAS \y+ \wDeagle\r]", "", ADMIN_ACCESS)




Above is just a partial script from .sma file.
I want to add message between the menu title "WP Gaming Weapon Menu" and the weapons list, like it shows with the arrow and blue line in this picture. That's Where I want to write this text: "Want Admin? Apply on Facebook"


Thanks!


1st next time post source codes between or 2nd It's not possible to write blue text in menu, only thorugh simple hudmessages i think but i would
be complicated. the thing i think of is making the menu through hudmessages like the normal menu is but you'll need more scripting than that, if you can do it s good. but through the menu system it's not possible and i hope the devs will add more colors to both menu systems in amx.

Edit: sorry if i misunderstood anything + man you didn't post any photo.

Last edited by AnimalMonster; 10-31-2020 at 22:15.
AnimalMonster is offline
Mmiicchhaaeell
Member
Join Date: Oct 2020
Old 10-31-2020 , 22:41   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #4

It was just showing in the picture with blue arrow. (I dont know why picture is not showing, I posted link). So I am not looking for blue color, just regular white color. https://ibb.co/q0L2Wnz

Here is the link. In the picture I just show with the blue arrow, where I want to insert the text on the second line. With white letters.




menu = menu_create("\r[\wW\rP \yGaming | \rWeapon \wMenu\r]", "VIP_handler")

-----------THE SECOND LINE TEXT WOULD GO HERE-------------

if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)

Last edited by Mmiicchhaaeell; 10-31-2020 at 23:26.
Mmiicchhaaeell is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 10-31-2020 , 23:37   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #5

Quote:
Originally Posted by Mmiicchhaaeell View Post
It was just showing in the picture with blue arrow. (I dont know why picture is not showing, I posted link). So I am not looking for blue color, just regular white color. https://ibb.co/q0L2Wnz

Here is the link. In the picture I just show with the blue arrow, where I want to insert the text on the second line. With white letters.




menu = menu_create("\r[\wW\rP \yGaming | \rWeapon \wMenu\r]", "VIP_handler")

-----------REQUESTED TEXT WOULD GO HERE-------------

if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
all you can do is <--- to be simple else you can't, if you cannot work with this type of menu for doing this(like i do) try this:
PHP Code:
#include <amxmodx>

new KEYS MENU_KEY_0 MENU_KEY_1 MENU_KEY_2 MENU_KEY_3 MENU_KEY_4 MENU_KEY_5 MENU_KEY_6 MENU_KEY_7 MENU_KEY_8 MENU_KEY_9

public plugin_init() {

    
register_clcmd("/test""menuCmd")
    
register_menu("menu"KEYS"handle")
}

public 
menuCmd(id)
{
    new 
text[128], len
    
    len 
0

    len 
formatex(text[len], charsmax(text), "\r[\wW\rP \yGaming | \rWeapon \wMenu\r]^n")
    
    
len += formatex(text[len], charsmax(text), "<------^n")
    
    
len += formatex(text[len], charsmax(text), "\r[\wM4A1 \y+ \wDeagle\r]^n")
    
KEYS |= MENU_KEY_1

    show_menu
(idKEYStext, -1"menu")
}

public 
handle(id)
{
    switch(
KEYS)
    {
        case 
0:{ // code }
    
}

Got this code from a youtuber that was posting knife menu
And this i really efficient if you want to do thing like that. I remember that Zombie Plague's Game Menu is made same way as this one ro something alike
+ in menu like this i gave you you can put 1. with color or even better One. or 1st. or anyway you want bcs it won t be put auto, you need to write it.

Last edited by AnimalMonster; 10-31-2020 at 23:42.
AnimalMonster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-31-2020 , 23:44   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #6

Have you tried just adding a "^n" (aka "new line") in the menu_create() string? If it works at all, the space will probably still be there but you'll have an extra line of text.
__________________

Last edited by fysiks; 10-31-2020 at 23:45.
fysiks is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-01-2020 , 00:01   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Have you tried just adding a "^n" (aka "new line") in the menu_create() string? If it works at all, the space will probably still be there but you'll have an extra line of text.
I tried ir before and didn't work that s why i didn t suggest that....
AnimalMonster is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-01-2020 , 07:23   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #8

^n works just fine in menus.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-01-2020 , 11:15   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
^n works just fine in menus.
Good to know thx you both for correcting me
AnimalMonster is offline
Mmiicchhaaeell
Member
Join Date: Oct 2020
Old 11-01-2020 , 22:49   Re: Can someone tell me how to add message in .sma file?
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
^n works just fine in menus.
I tried it, but not working. I am probably doing it wrong. Can you please show me how you would enter the line, using ^n. Thanks!



menu = menu_create("\r[\wW\rP \yGaming | \rWeapon \wMenu\r]", "VIP_handler")

-----------REQUESTED TEXT WOULD GO HERE-------------

if(flags & ADMIN_ALL)
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
else
menu_additem( menu, "\r[\wM4A1 \y+ \wDeagle\r]", "", ADMIN_ACCESS)
Mmiicchhaaeell is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode