AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [HELP] SetMenuTitle String fromatted incorrectly (https://forums.alliedmods.net/showthread.php?t=256001)

EngHell 01-22-2015 18:47

[HELP] SetMenuTitle String fromatted incorrectly
 
I got these logs:
PHP Code:

L 01/22/2015 22:53:36: [SMPlugin encountered error 4Invalid parameter or parameter type
L 01
/22/2015 22:53:36: [SMNative "SetMenuTitle" reportedString formatted incorrectly parameter 3 (total 3)
L 01/22/2015 22:53:36: [SMDisplaying call stack trace for plugin "noscope.smx":
L 01/22/2015 22:53:36: [SM]   [0]  Line 162C:\Users\Angel\Documents\sourcepawn\noscope.sp::Cmd_NoscopeVoteRun() 

And this is the related code:

PHP Code:

public Action:Cmd_NoscopeVoteRun(clientargs)
{
    if (!
IsVoteInProgress())
    {
        new 
votedelay CheckVoteDelay();
        if (
votedelay == 0)
        {
            new 
Handle:menu CreateMenu(Handle_NoscopeMenuMENU_ACTIONS_ALL);
            
SetVoteResultCallback(menuHandle_VoteResultsNoscope);
            
SetMenuTitle(menu"%T""Menu Title");
            
AddMenuItem(menu"CHOICEyes""YES");
            
AddMenuItem(menu"CHOICEno""NO");
            
SetMenuExitButton(menufalse);
            
VoteMenuToAll(menu20);
        }else {
            
PrintToChat(client"%T""Vote delay"votedelay);
        }
    } else {
        
PrintToChat(client"%T""Vote in Progres");
    }
    return 
Plugin_Continue;



Dkmuniz 01-22-2015 20:40

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Are you using a translation file, can upload where is Menu Title ?

EngHell 01-22-2015 21:02

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Yes, I'm using a translation file, but I just fixed it like this
PHP Code:

SetMenuTitle(menu"%T""Menu Title",LANG_SERVER); 


Dkmuniz 01-23-2015 08:37

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Quote:

Originally Posted by EngHell (Post 2252593)
Yes, I'm using a translation file, but I just fixed it like this
PHP Code:

SetMenuTitle(menu"%T""Menu Title",LANG_SERVER); 


But you want to put onle handle in menu ?
Try:
Code:

SetMenuTitle(menu, "%t","Title");
Translation:
Code:

"Title"
        {
                "en"                "Text here:"
        }


Powerlord 01-23-2015 09:40

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Quote:

Originally Posted by Dkmuniz (Post 2252757)
But you want to put onle handle in menu ?
Try:
Code:

SetMenuTitle(menu, "%t","Title");
Translation:
Code:

"Title"
        {
                "en"                "Text here:"
        }


%t only works on operations that target a client.

If you want to translate the menu title for each person, you need to handle MenuAction_Display in the menu callback and use SetPanelTitle on param2. I think the Menus Step by Step wiki page has an example of this.

EngHell 01-23-2015 17:19

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Quote:

Originally Posted by Powerlord (Post 2252779)
%t only works on operations that target a client.

If you want to translate the menu title for each person, you need to handle MenuAction_Display in the menu callback and use SetPanelTitle on param2. I think the Menus Step by Step wiki page has an example of this.

Yes i have done it in that way and all works nice now, now one not related question, but is there a way to run sourcemod under cs go, no a dedicated server installation more like it was possible to run amxmodx in the single game on cs 1.6, is there any way to do it? cause test in a live server is not like...

Potato Uno 01-23-2015 17:49

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Asherkin (or psychonic) said it's not possible. (If neither of them, I knew it was some dev who said that.)

That being said, I managed to get it to work on a TF2 client copy (I use it to automate MvM mission testing) so you can try it and see.

I recommend making a copy of your game and then attempt to install it on the copy version.

EngHell 01-23-2015 18:47

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Quote:

Originally Posted by Potato Uno (Post 2252937)
Asherkin (or psychonic) said it's not possible. (If neither of them, I knew it was some dev who said that.)

That being said, I managed to get it to work on a TF2 client copy (I use it to automate MvM mission testing) so you can try it and see.

I recommend making a copy of your game and then attempt to install it on the copy version.

Can you give me some instructions, i tried to install it as a normal sourcemod installation, but didn't work

Potato Uno 01-23-2015 19:30

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
I followed the same instructions as that for the dedicated server.

So for TF2, I just put the /addons/ folder in /tf/.

For CS:GO, I think it's the /csgo/ folder where the /addons/ folder goes to? (Wherever it goes to in the dedicated server, put it there in the client CS:GO.)

Copy the sourcemod installation from your server and paste it into your client game. Do note that you have to load a map for metamod to take place (though it will still recognize the "meta" command).

If it doesn't work, then just as the devs said, it probably doesn't work on client games.

EngHell 01-23-2015 20:37

Re: [HELP] SetMenuTitle String fromatted incorrectly
 
Quote:

Originally Posted by Potato Uno (Post 2252988)
I followed the same instructions as that for the dedicated server.

So for TF2, I just put the /addons/ folder in /tf/.

For CS:GO, I think it's the /csgo/ folder where the /addons/ folder goes to? (Wherever it goes to in the dedicated server, put it there in the client CS:GO.)

Copy the sourcemod installation from your server and paste it into your client game. Do note that you have to load a map for metamod to take place (though it will still recognize the "meta" command).

If it doesn't work, then just as the devs said, it probably doesn't work on client games.

I have already did it, then there's not a classic way of get this :(

Unless i install a local srds, which will be the simplest then


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

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