AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can someone tell me how to add message in .sma file? (https://forums.alliedmods.net/showthread.php?t=328220)

Mmiicchhaaeell 10-31-2020 20:06

Can someone tell me how to add message in .sma file?
 
#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!


http://ibb.co/q0L2Wnz

Psyk0tik 10-31-2020 21:21

Re: Can someone tell me how to add message in .sma file?
 
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.

AnimalMonster 10-31-2020 22:13

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

Originally Posted by Mmiicchhaaeell (Post 2723278)
#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!


http://ibb.co/q0L2Wnz

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.

Mmiicchhaaeell 10-31-2020 22:41

Re: Can someone tell me how to add message in .sma file?
 
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)

AnimalMonster 10-31-2020 23:37

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

Originally Posted by Mmiicchhaaeell (Post 2723286)
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.

fysiks 10-31-2020 23:44

Re: Can someone tell me how to add message in .sma file?
 
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.

AnimalMonster 11-01-2020 00:01

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

Originally Posted by fysiks (Post 2723289)
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....

OciXCrom 11-01-2020 07:23

Re: Can someone tell me how to add message in .sma file?
 
^n works just fine in menus.

AnimalMonster 11-01-2020 11:15

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

Originally Posted by OciXCrom (Post 2723306)
^n works just fine in menus.

Good to know thx you both for correcting me

Mmiicchhaaeell 11-01-2020 22:49

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

Originally Posted by OciXCrom (Post 2723306)
^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)


All times are GMT -4. The time now is 05:42.

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