Raised This Month: $ Target: $400
 0% 

fantastiko


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-07-2013 , 03:00   Re: FM_GetGameDescription
Reply With Quote #7

You don't need cvar pointer at all since you only retrieve value once.

You can do this :

PHP Code:
#include < amxmodx >
#include < fakemeta >

new g_szGameDesc[5];

public 
plugin_init()
{
    
g_szGameDesc get_cvar_num("mp_teamplay") ? "team" "hldm";
    
register_forward(FM_GetGameDescription"Game");
}

public 
Game() 
{
    
forward_return(FMV_STRINGg_szGameDesc);
    return 
FMRES_SUPERCEDE;

or this :

PHP Code:
#include < amxmodx >
#include < fakemeta >

public plugin_init()
{
    
register_forward(FM_GetGameDescriptionget_cvar_num("mp_teamplay") ? "Game_team" "Game_hldm")
}

public 
Game_team() 
{
    
forward_return(FMV_STRING"team")
    return 
FMRES_SUPERCEDE
}

public 
Game_hldm() 
{
    
forward_return(FMV_STRING"hldm")
    return 
FMRES_SUPERCEDE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 19:13.


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