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

fantastiko


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fantastiko
BANNED
Join Date: Feb 2013
Old 09-06-2013 , 13:43   fantastiko
Reply With Quote #1

fantastiko

Last edited by fantastiko; 11-23-2013 at 03:35.
fantastiko is offline
Winchester90
Senior Member
Join Date: May 2013
Location: Dale! RG4L Baby
Old 09-06-2013 , 14:31   Re: FM_GetGameDescription
Reply With Quote #2

Try this

And your code its wrong

Code:
new amx_gamename; public plugin_init( ) {     register_plugin( "Game Namer", "1.1", "NeuroToxin" );     amx_gamename = register_cvar( "amx_gamename", "Team Fortress Classic" );     register_forward( FM_GetGameDescription, "GameDesc" ); }   public GameDesc( ) {     static gamename[32];     get_pcvar_string( amx_gamename, gamename, 31 );     forward_return( FMV_STRING, gamename );     return FMRES_SUPERCEDE; }
__________________
Proyectos No comercio XD
Zombie Resurection 1.0 (45%)

Last edited by Winchester90; 09-06-2013 at 14:34.
Winchester90 is offline
kNowo
Senior Member
Join Date: Apr 2011
Location: Malaysia
Old 09-06-2013 , 15:16   Re: FM_GetGameDescription
Reply With Quote #3

For teamplay in HL, mp_teamplay should be set greater than 1. Value 0 or 1 means no teamplay. Also, changing game descriptions has been blocked (or can only be changed one time).
kNowo is offline
SpaWn2KiLl
Member
Join Date: Aug 2012
Old 09-06-2013 , 16:35   Re: FM_GetGameDescription
Reply With Quote #4

Quote:
Originally Posted by kNowo View Post
For teamplay in HL, mp_teamplay should be set greater than 1. Value 0 or 1 means no teamplay. Also, changing game descriptions has been blocked (or can only be changed one time).
Winchester90 changing game description method works...
__________________
SpaWn2KiLl is offline
Old 09-07-2013, 01:52
fantastiko
This message has been deleted by fantastiko.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-07-2013 , 02:51   Re: FM_GetGameDescription
Reply With Quote #5

The title doesn't match the first post. What is going on here?
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-07-2013 , 03:00   Re: FM_GetGameDescription
Reply With Quote #6

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


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