AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add name into Menu (https://forums.alliedmods.net/showthread.php?t=251929)

DataCore 11-22-2014 12:06

Add name into Menu
 
Hey all!

I have this code:
PHP Code:

new maxplayers

public plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_clcmd"say /menu","Menu"
    
register_clcmd"say_team /menu","Menu")
    
maxplayers get_maxplayers()

public 
Menu(id

    for(new 
<= maxplayers i++)
{    
    new 
menu menu_create("Menu""Menu_Handler")
    new 
name[32]
    
get_user_nameiname63 )
    
menu_additem(menu"Your name is: %s",name0)

    
menu_setprop(menuMPROP_EXIT0)
    
menu_display(idmenu0)
}  


What is wrong? Name wont appear.

YamiKaitou 11-22-2014 12:16

Re: Add name into Menu
 
menu_additem does not format strings. You need to use format(ex)

DataCore 11-22-2014 13:19

Re: Add name into Menu
 
Can u help me out?

YamiKaitou 11-22-2014 13:21

Re: Add name into Menu
 
This thread has examples of how to do it


All times are GMT -4. The time now is 17:38.

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