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

[HELP] SetMenuTitle String fromatted incorrectly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-22-2015 , 18:47   [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #1

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;

EngHell is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-22-2015 , 20:40   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #2

Are you using a translation file, can upload where is Menu Title ?
Dkmuniz is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-22-2015 , 21:02   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #3

Yes, I'm using a translation file, but I just fixed it like this
PHP Code:
SetMenuTitle(menu"%T""Menu Title",LANG_SERVER); 
EngHell is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-23-2015 , 08:37   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #4

Quote:
Originally Posted by EngHell View Post
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:"
	}
Dkmuniz is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-23-2015 , 09:40   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #5

Quote:
Originally Posted by Dkmuniz View Post
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.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-23-2015 , 17:19   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
%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...
EngHell is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-23-2015 , 17:49   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #7

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.
Potato Uno is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-23-2015 , 18:47   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #8

Quote:
Originally Posted by Potato Uno View Post
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

Last edited by EngHell; 01-23-2015 at 19:13.
EngHell is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-23-2015 , 19:30   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #9

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.

Last edited by Potato Uno; 01-23-2015 at 19:30.
Potato Uno is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-23-2015 , 20:37   Re: [HELP] SetMenuTitle String fromatted incorrectly
Reply With Quote #10

Quote:
Originally Posted by Potato Uno View Post
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

Last edited by EngHell; 01-23-2015 at 20:38.
EngHell 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 04:01.


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