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

wierd problem with FM_GetGameDescription


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-29-2018 , 21:51   wierd problem with FM_GetGameDescription
Reply With Quote #1

Hello friends, once again I ask for a light for a strange problem, In the example below when I try to change the name of the game to the name of the mod I am receiving an empty string, however if I debug the message with a %s, I get perfectly string, what's wrong?


PHP Code:
register_forward(FM_GetGameDescription"GameDesc")

public 
GameDesc() 

    static 
szMod[20]
    
get_gamemode(szModcharsmax(szMod))
    
forward_return(FMV_STRINGfmt("[%s]"szMod))
    return 
FMRES_SUPERCEDE
}

get_gamemode(szBuffer[], iLen)
{
    if(
something)
             
formatex(szBufferiLen"something")
        
    else if(
any)    
          
formatex(szBufferiLen"any")


Last edited by iceeedr; 06-29-2018 at 21:54.
iceeedr is offline
Send a message via Skype™ to iceeedr
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-30-2018 , 02:05   Re: wierd problem with FM_GetGameDescription
Reply With Quote #2

Try with FMRES_OVERRIDE instead.
__________________
klippy is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-30-2018 , 11:36   Re: wierd problem with FM_GetGameDescription
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
Try with FMRES_OVERRIDE instead.
KliPPy, thanks for the answer, below the result. Any idea?

With SUPERCEDE
https://ibb.co/e3jWHJ


With OVERRIDE
https://ibb.co/ds9sPy

Last edited by iceeedr; 06-30-2018 at 11:38.
iceeedr is offline
Send a message via Skype™ to iceeedr
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-01-2018 , 08:11   Re: wierd problem with FM_GetGameDescription
Reply With Quote #4

Still no results, no one going through this?
iceeedr is offline
Send a message via Skype™ to iceeedr
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-01-2018 , 14:12   Re: wierd problem with FM_GetGameDescription
Reply With Quote #5

From zp50_serverbrowser_info

Code:
/*================================================================================         --------------------------------     -*- [ZP] Server Broswer Info -*-     --------------------------------         This plugin is part of Zombie Plague Mod and is distributed under the     terms of the GNU General Public License. Check ZP_ReadMe.txt for details.     ================================================================================*/ #include <amxmodx> #include <fakemeta> #include <zp50_core> new g_ModName[64] public plugin_init() {     register_plugin("[ZP] Server Browser Info", ZP_VERSION_STRING, "ZP Dev Team")         register_forward(FM_GetGameDescription, "fw_GetGameDescription")     formatex(g_ModName, charsmax(g_ModName), "Zombie Plague %s", ZP_VERSION_STR_LONG) } // Forward Get Game Description public fw_GetGameDescription() {     // Return the mod name so it can be easily identified     forward_return(FMV_STRING, g_ModName)         return FMRES_SUPERCEDE; }
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-01-2018 , 14:42   Re: wierd problem with FM_GetGameDescription
Reply With Quote #6

Quote:
Originally Posted by CrazY. View Post
From zp50_serverbrowser_info

Code:
/*================================================================================         --------------------------------     -*- [ZP] Server Broswer Info -*-     --------------------------------         This plugin is part of Zombie Plague Mod and is distributed under the     terms of the GNU General Public License. Check ZP_ReadMe.txt for details.     ================================================================================*/ #include <amxmodx> #include <fakemeta> #include <zp50_core> new g_ModName[64] public plugin_init() {     register_plugin("[ZP] Server Browser Info", ZP_VERSION_STRING, "ZP Dev Team")         register_forward(FM_GetGameDescription, "fw_GetGameDescription")     formatex(g_ModName, charsmax(g_ModName), "Zombie Plague %s", ZP_VERSION_STR_LONG) } // Forward Get Game Description public fw_GetGameDescription() {     // Return the mod name so it can be easily identified     forward_return(FMV_STRING, g_ModName)         return FMRES_SUPERCEDE; }

Exactly as I do, the difference is that I format the string with "fmv" from amxx 1.8.3. any other idea of ​​what it might be?
iceeedr is offline
Send a message via Skype™ to iceeedr
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-01-2018 , 15:04   Re: wierd problem with FM_GetGameDescription
Reply With Quote #7

Post full code, otherwise we can't help you.
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-01-2018 , 15:08   Re: wierd problem with FM_GetGameDescription
Reply With Quote #8

I post exactly what I tried to do, with that code if I make a debug I receive a string like I format, but when tried to use the same string on the gamedescription stay blank
iceeedr is offline
Send a message via Skype™ to iceeedr
Old 07-01-2018, 16:01
Ghosted
This message has been deleted by Ghosted. Reason: dont think so
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-01-2018 , 16:03   Re: wierd problem with FM_GetGameDescription
Reply With Quote #9

Quote:
Originally Posted by iceeedr View Post
I post exactly what I tried to do, with that code if I make a debug I receive a string like I format, but when tried to use the same string on the gamedescription stay blank
Try that one posted by crazy.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-01-2018 at 16:03.
Ghosted is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-02-2018 , 14:06   Re: wierd problem with FM_GetGameDescription
Reply With Quote #10

Quote:
Originally Posted by Ghosted View Post
Try that one posted by crazy.
It's the same as mine, but okay! Tested and disapproved, any ideas?

PHP Code:
register_forward(FM_GetGameDescription"GameDesc")

get_mode(szBuffer[], iLen)
{
    if(
GameItsUp))
    
formatex(szBufferiLen"Load")
}
public 
GameDesc() 

    static 
szMod[20], szName[20]
    
get_mode(szModcharsmax(szMod))
    
formatex(szNamecharsmax(szName), "[%s]"szMod)
    
forward_return(FMV_STRINGszName// here I received a blank gamename "Load"
    
return FMRES_SUPERCEDE
}

public 
EventNewRnd()
{
    
GameItsUp true
    
static szMod[20]
    
get_mode(szModcharsmax(szMod))
    
    
CC_SendMatched(0RED"%s"szMod// here I received a perfectly string 


Last edited by iceeedr; 07-02-2018 at 14:11.
iceeedr is offline
Send a message via Skype™ to iceeedr
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 21:28.


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