Raised This Month: $ Target: $400
 0% 

FM_GetGameDescription Not working for me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 11:31   FM_GetGameDescription Not working for me
Reply With Quote #1

PHP Code:
register_forwardFM_GetGameDescription"Game_Name" 
PHP Code:
public Game_Name()
{
    static const 
Game_Name_Des[] = " NOOB | Jailbreak"
    
forward_return(FMV_STRINGGame_Name_Des)


Doesn't change the name at all.
proffs is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2014 , 11:44   Re: FM_GetGameDescription Not working for me
Reply With Quote #2

This forward is called one time at server start only.
__________________
Arkshine is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 11:54   Re: FM_GetGameDescription Not working for me
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
This forward is called one time at server start only.
Can I make this to check everytime a map changes?
proffs is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2014 , 11:58   Re: FM_GetGameDescription Not working for me
Reply With Quote #4

No, this not an AMXX issue. And this is not an issue itself anyway. That's said it may exist a tricky way, but for now, answer is no.
__________________
Arkshine is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 03-14-2014 , 08:25   Re: FM_GetGameDescription Not working for me
Reply With Quote #5

After returning the string, you MUST block the hook with FMRES_SUPERCEDE:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init(){
    
register_plugin("Game Change Test","1337","Hyuna");

    
register_forward(FM_GetGameDescription,"fw_GetGameDescriptionPre",0) ;
}

public 
fw_GetGameDescriptionPre(){
    static const 
MyNewGameName[] = "ChangeMeLoL";

    
forward_return(FMV_STRING,MyNewGameName);

    return 
FMRES_SUPERCEDE;

Works for me
__________________
simanovich 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 05:56.


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