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

Solved GameName Issue.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-09-2019 , 11:05   GameName Issue.
Reply With Quote #1

PHP Code:
//                                [SCORE IN GAMENAME]
enum eTeams TEAM_TTEAM_CT };
new 
g_iScore[eTeams];




public 
plugin_init()
{
    
//                           [GAMENAME STUFF]
    
register_event"TeamScore""TeamScore""a""1=TERRORIST""1=CT" )
    
register_forwardFM_GetGameDescription"GameName" )
}



//                                 [GAMENAME STUFF]
public GameName( ) { 

    if ( 
IsMatchLive == true 
    {
    new 
szGameName15 ]
    
formatex(szGameNamecharsmaxszGameName ), "[T]%d - %d[CT]"g_iScore[TEAM_T], g_iScore[TEAM_CT])
    
forward_returnFMV_STRINGszGameName )
    }
    
    if ( 
IsMatchLive == false)
    {
    new 
szGameName15 ]
    
formatex(szGameNamecharsmaxszGameName ), "%s eCUP"g_Tag)
    
forward_returnFMV_STRINGszGameName )
    }


    return 
FMRES_SUPERCEDE;
}
//                                [JUST TEAMSCORE STUFF]
public TeamScore( ) {
    static 
szTeam]
    
read_data1szTeam)
    
g_iScoreszTeam] == 'T' TEAM_T TEAM_CT ] = read_data)

    return 
PLUGIN_HANDLED;

Issue: Doesn't work at all, gamename stays "Counter-Strike"


Any idea why?

EDIT: Restarting server seems to change the GameName to the second if condition, but if IsMatchLive becomes true, it never changes afterwards.

USING AMXX 1.8.2. None of the replies actually helped me, yes I even tried the REAPI way, I think it's only for 1.8.3.
__________________

Last edited by deprale; 02-14-2019 at 15:23.
deprale is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 02-09-2019 , 14:14   Re: GameName Issue.
Reply With Quote #2

P.S. FM_GetGameDescription is too bad.
__________________
eat1k is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-09-2019 , 14:42   Re: GameName Issue.
Reply With Quote #3

https://github.com/evandrocoan/Multi...owser_info.sma
__________________








CrazY. is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-09-2019 , 15:13   Re: GameName Issue.
Reply With Quote #4

Thanks, CrazY . Solved!

EDIT: ACTUALLY DOESNT WORK.
__________________

Last edited by deprale; 02-10-2019 at 02:26.
deprale is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-09-2019 , 17:18   Re: GameName Issue.
Reply With Quote #5

Hmm, actually your code seems to be fine, the only thing you did wrong is:

Code:
    if ( IsMatchLive == true )      {         new szGameName[ 15 ]         formatex(szGameName, charsmax( szGameName ), "[T]%d - %d[CT]", g_iScore[TEAM_T], g_iScore[TEAM_CT])         forward_return( FMV_STRING, szGameName )     }           if ( IsMatchLive == false)     {         new szGameName[ 15 ]         formatex(szGameName, charsmax( szGameName ), "%s eCUP", g_Tag)         forward_return( FMV_STRING, szGameName )     }



Code:
    if ( IsMatchLive == true )      {         new szGameName[ 15 ]         formatex(szGameName, charsmax( szGameName ), "[T]%d - %d[CT]", g_iScore[TEAM_T], g_iScore[TEAM_CT])         forward_return( FMV_STRING, szGameName )     }     else     {         new szGameName[ 15 ]         formatex(szGameName, charsmax( szGameName ), "%s eCUP", g_Tag)         forward_return( FMV_STRING, szGameName )     }

This should fix the problem.
__________________









Last edited by CrazY.; 02-09-2019 at 17:19.
CrazY. is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-09-2019 , 17:31   Re: GameName Issue.
Reply With Quote #6

Yeah that's essentially how I fixed it (mostly)

Thanks, CrazY, always helpful!

EDIT: Doesnt work The gamename never gets updated.
__________________

Last edited by deprale; 02-10-2019 at 02:37.
deprale is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-09-2019 , 17:32   Re: GameName Issue.
Reply With Quote #7

Quote:
Originally Posted by eat1k View Post
P.S. FM_GetGameDescription is too bad.
Umm, what?
Don't wanna be rude but also don't wanna believe everything I read on the internet, mind giving an argument as to why it's bad?


P.S SRY DOUBLEPOST, again... I didn't notice I already replied to someone - I'm on hotspot right now and I didn't see my reply after a refresh, assumed It didn't go through.
__________________

Last edited by deprale; 02-09-2019 at 17:33.
deprale is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 02-09-2019 , 17:57   Re: GameName Issue.
Reply With Quote #8

Quote:
Originally Posted by deprale View Post
Umm, what?
Don't wanna be rude but also don't wanna believe everything I read on the internet, mind giving an argument as to why it's bad?


P.S SRY DOUBLEPOST, again... I didn't notice I already replied to someone - I'm on hotspot right now and I didn't see my reply after a refresh, assumed It didn't go through.
https://dev-cs.ru/threads/3863/#post-41180

The best way is using set_member_game + m_GameDesc. However, if you don't have ReAPI, so you don't have other way.
__________________
eat1k is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-10-2019 , 02:27   Re: GameName Issue.
Reply With Quote #9

Quote:
Originally Posted by eat1k View Post
https://dev-cs.ru/threads/3863/#post-41180

The best way is using set_member_game + m_GameDesc. However, if you don't have ReAPI, so you don't have other way.
except it doesnt work in 1.8.2
__________________

Last edited by deprale; 02-10-2019 at 02:27.
deprale is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 02-10-2019 , 03:10   Re: GameName Issue.
Reply With Quote #10

Quote:
Originally Posted by deprale View Post
except it doesnt work in 1.8.2
What doesn’t work in 1.8.2? ReAPI does. Btw, you could update your version to 1.9.0.5241 (it’s fixed a crash with mebu_display btw) or 1.10.0.5248. You can check my plugin GameName Wins (ReAPI + AMXX >= 1.9.0).
__________________

Last edited by eat1k; 02-10-2019 at 03:12.
eat1k 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 06:24.


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