AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   FM_GetGameDescription Not working for me (https://forums.alliedmods.net/showthread.php?t=236861)

proffs 03-12-2014 11:31

FM_GetGameDescription Not working for me
 
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.

Arkshine 03-12-2014 11:44

Re: FM_GetGameDescription Not working for me
 
This forward is called one time at server start only.

proffs 03-12-2014 11:54

Re: FM_GetGameDescription Not working for me
 
Quote:

Originally Posted by Arkshine (Post 2110889)
This forward is called one time at server start only.

Can I make this to check everytime a map changes?

Arkshine 03-12-2014 11:58

Re: FM_GetGameDescription Not working for me
 
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.

simanovich 03-14-2014 08:25

Re: FM_GetGameDescription Not working for me
 
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


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

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