AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get game description (https://forums.alliedmods.net/showthread.php?t=63044)

l4ulwtlln 11-10-2007 12:47

get game description
 
i kno that u can change the game name using fakemeta but im curious to kno if it is possible to just return the current game name. the game name is that name in the server list. example: "Counter-Strike", "Team Fortress", "Half-Life", ect. so is there any possible way to just return the name instead of setting it?

Alka 11-10-2007 13:16

Re: get game description
 
Code:

  // Returns string describing current .dll.  E.g., TeamFotrress 2, Half-Life
        DLLFunc_GetGameDescription,        // const char * )(void);


vittu 11-10-2007 13:22

Re: get game description
 
You don't just want mod name instead?:
http://www.amxmodx.org/funcwiki.php?go=func&id=248

Otherwise yea, the forward would just pass in the full game name.

l4ulwtlln 11-10-2007 13:33

Re: get game description
 
i kno that already but how do i get it to print the name out without changing the game name?


@vittu, not really because i want to get the name then change it while keeping the original but adding something to the end

Alka 11-10-2007 13:43

Re: get game description
 
Yup. :)

Code:

#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "GameName Description"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_forward(FM_GetGameDescription, "Fwd_GameDescription");
}
 
public Fwd_GameDescription()
{
 new GameName[32];
 dllfunc(DLLFunc_GetGameDescription, GameName, sizeof GameName - 1);
 
 new Buffer[128];
 formatex(Buffer, sizeof Buffer - 1, "%s | 1337", GameName); //Modify here.
 
 forward_return(FMV_STRING, Buffer);
 
 return FMRES_SUPERCEDE;
}

I love fakemeta. lol

vittu 11-10-2007 13:53

Re: get game description
 
Use add() instead of formatex if you are just adding something to the end of the text.

l4ulwtlln 11-10-2007 15:56

Re: get game description
 
ty! it works! and i will use add


All times are GMT -4. The time now is 01:16.

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