AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fantastiko (https://forums.alliedmods.net/showthread.php?t=225593)

fantastiko 09-06-2013 13:43

fantastiko
 
fantastiko

Winchester90 09-06-2013 14:31

Re: FM_GetGameDescription
 
Try this :D

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; }

kNowo 09-06-2013 15:16

Re: FM_GetGameDescription
 
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).

SpaWn2KiLl 09-06-2013 16:35

Re: FM_GetGameDescription
 
Quote:

Originally Posted by kNowo (Post 2029587)
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...

fysiks 09-07-2013 02:51

Re: FM_GetGameDescription
 
The title doesn't match the first post. What is going on here?

ConnorMcLeod 09-07-2013 03:00

Re: FM_GetGameDescription
 
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




All times are GMT -4. The time now is 19:13.

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