Raised This Month: $ Target: $400
 0% 

get game description


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
l4ulwtlln
Member
Join Date: Aug 2007
Old 11-10-2007 , 12:47   get game description
Reply With Quote #1

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?
l4ulwtlln is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 13:16   Re: get game description
Reply With Quote #2

Code:
  // Returns string describing current .dll.  E.g., TeamFotrress 2, Half-Life
	DLLFunc_GetGameDescription,	// const char * )(void);
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 11-10-2007 , 13:22   Re: get game description
Reply With Quote #3

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.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
l4ulwtlln
Member
Join Date: Aug 2007
Old 11-10-2007 , 13:33   Re: get game description
Reply With Quote #4

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
l4ulwtlln is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 13:43   Re: get game description
Reply With Quote #5

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
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 11-10-2007 , 13:53   Re: get game description
Reply With Quote #6

Use add() instead of formatex if you are just adding something to the end of the text.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
l4ulwtlln
Member
Join Date: Aug 2007
Old 11-10-2007 , 15:56   Re: get game description
Reply With Quote #7

ty! it works! and i will use add
l4ulwtlln 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 01:16.


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