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

GET5 - Changing player to team in config translations.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SNARX
Junior Member
Join Date: Aug 2019
Old 08-22-2019 , 12:00   GET5 - Changing player to team in config translations.
Reply With Quote #1

Hi, I'm using the Get5 plugin by the author "splewis", here's the explanation of my problem.

Expected behavior

When enters the .pause command, "SNARX paused the match" appears in the chat.

Actual behavior

I would like to do so that instead of my Steam name the name of the team from which the pause command was just sent was displayed.

Code:
  if (IsPlayer(client)) { 
Get5_MessageToAll("%t", "MatchPausedByTeamMessage", client); 
}
SNARX is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-22-2019 , 13:57   Re: GET5 - Changing player to team in config translations.
Reply With Quote #2

Somthing along these lines should work, not at home so I couldn't compile.

PHP Code:
char sTeamName[32];
int iPlayerTeam GetClientTeam(client); //Get this when .pause is typed.

if (iPlayerTeam == 3);
{
  
GetConVarString(mp_teamname_1sTeamName(sizeof(TeamName)));
  
//Print Message here
}
else if (
iPlayerTeam == 2);
{
  
GetConVarString(mp_teamname_2sTeamName(sizeof(Teamname)));
  
//Print Message Here

Edit - I wrote this in Notepad so cut me some slack.

Last edited by Halt; 08-22-2019 at 14:12.
Halt is offline
SNARX
Junior Member
Join Date: Aug 2019
Old 08-22-2019 , 15:12   Re: GET5 - Changing player to team in config translations.
Reply With Quote #3

Quote:
Originally Posted by Halt View Post
Somthing along these lines should work, not at home so I couldn't compile.

PHP Code:
char sTeamName[32];
int iPlayerTeam GetClientTeam(client); //Get this when .pause is typed.

if (iPlayerTeam == 3);
{
  
GetConVarString(mp_teamname_1sTeamName(sizeof(TeamName)));
  
//Print Message here
}
else if (
iPlayerTeam == 2);
{
  
GetConVarString(mp_teamname_2sTeamName(sizeof(Teamname)));
  
//Print Message Here

Edit - I wrote this in Notepad so cut me some slack.
When compiling the file, such errors pop up.

Code:
/groups/sourcemod/upload_tmp/textcHLSb0.sp(4) : error 010: invalid function or declaration
/groups/sourcemod/upload_tmp/textcHLSb0.sp(8) : error 054: unmatched closing brace ("}")
/groups/sourcemod/upload_tmp/textcHLSb0.sp(9) : error 010: invalid function or declaration
/groups/sourcemod/upload_tmp/textcHLSb0.sp(13) : error 054: unmatched closing brace ("}")
/groups/sourcemod/upload_tmp/textcHLSb0.sp(2) : warning 203: symbol is never used: "iPlayerTeam"
/groups/sourcemod/upload_tmp/textcHLSb0.sp(6) : warning 203: symbol is never used: "mp_teamname_1"
/groups/sourcemod/upload_tmp/textcHLSb0.sp(11) : warning 203: symbol is never used: "mp_teamname_2"
/groups/sourcemod/upload_tmp/textcHLSb0.sp(1) : warning 203: symbol is never used: "sTeamName"

4 Errors.
SNARX is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-22-2019 , 15:19   Re: GET5 - Changing player to team in config translations.
Reply With Quote #4

I wrote this in Notepad

also I don't usually just "give the answer" I'm more interested in showing methods or explaining how I'd go about it.

Quote:
Somthing along these lines should work
If you don't write code PM me and I'll try to help when I can. I'm never at home so I'm always on my Mac (don't discriminate) but that limits my abilities to help.

Edit - All these errors are simple enough to debug even at a beginners level. And this is meant to be implemented to whatever plugin you're already using. Not a standalone.

Last edited by Halt; 08-22-2019 at 15:20.
Halt is offline
SNARX
Junior Member
Join Date: Aug 2019
Old 08-22-2019 , 15:40   Re: GET5 - Changing player to team in config translations.
Reply With Quote #5

Quote:
Originally Posted by Halt View Post
I wrote this in Notepad

also I don't usually just "give the answer" I'm more interested in showing methods or explaining how I'd go about it.



If you don't write code PM me and I'll try to help when I can. I'm never at home so I'm always on my Mac (don't discriminate) but that limits my abilities to help.

Edit - All these errors are simple enough to debug even at a beginners level. And this is meant to be implemented to whatever plugin you're already using. Not a standalone.
I wrote to you at PW.
SNARX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 08-23-2019 , 00:12   Re: GET5 - Changing player to team in config translations.
Reply With Quote #6

Copy the plugin and translation file.
See scripting/pausing.sp to see what I changed. (Line 62-74)
Attached Files
File Type: zip get5.zip (1.03 MB, 36 views)
__________________
Taking paid private requests! Contact me
Cruze is online now
SNARX
Junior Member
Join Date: Aug 2019
Old 08-23-2019 , 03:31   Re: GET5 - Changing player to team in config translations.
Reply With Quote #7

Quote:
Originally Posted by Cruze View Post
Copy the plugin and translation file.
See scripting/pausing.sp to see what I changed. (Line 62-74)
I have uploaded the file to the server, I just tested it and unfortunately no text is displayed after entering the command !pause

Last edited by SNARX; 08-23-2019 at 03:42.
SNARX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 08-23-2019 , 04:00   Re: GET5 - Changing player to team in config translations.
Reply With Quote #8

Show error log
__________________
Taking paid private requests! Contact me
Cruze is online now
SNARX
Junior Member
Join Date: Aug 2019
Old 08-23-2019 , 11:31   Re: GET5 - Changing player to team in config translations.
Reply With Quote #9

Quote:
Originally Posted by Cruze View Post
Show error log
Code:
L 08/23/2019 - 09:29:32: SourceMod error session started
L 08/23/2019 - 09:29:32: Info (map "de_cache") (file "errors_20190823.log")
L 08/23/2019 - 09:29:32: [SM] Exception reported: Client index 1296123220 is invalid (arg 3)
L 08/23/2019 - 09:29:32: [SM] Blaming: get5.smx
L 08/23/2019 - 09:29:32: [SM] Call stack trace:
L 08/23/2019 - 09:29:32: [SM]   [0] FormatNativeString
L 08/23/2019 - 09:29:32: [SM]   [1] Line 96, get5/natives.sp::Native_MessageToAll
L 08/23/2019 - 09:29:32: [SM]   [3] Get5_MessageToAll
L 08/23/2019 - 09:29:32: [SM]   [4] Line 68, get5/pausing.sp::Command_Pause
SNARX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 08-23-2019 , 12:29   Re: GET5 - Changing player to team in config translations.
Reply With Quote #10

Quote:
Originally Posted by SNARX View Post
Code:
L 08/23/2019 - 09:29:32: SourceMod error session started
L 08/23/2019 - 09:29:32: Info (map "de_cache") (file "errors_20190823.log")
L 08/23/2019 - 09:29:32: [SM] Exception reported: Client index 1296123220 is invalid (arg 3)
L 08/23/2019 - 09:29:32: [SM] Blaming: get5.smx
L 08/23/2019 - 09:29:32: [SM] Call stack trace:
L 08/23/2019 - 09:29:32: [SM]   [0] FormatNativeString
L 08/23/2019 - 09:29:32: [SM]   [1] Line 96, get5/natives.sp::Native_MessageToAll
L 08/23/2019 - 09:29:32: [SM]   [3] Get5_MessageToAll
L 08/23/2019 - 09:29:32: [SM]   [4] Line 68, get5/pausing.sp::Command_Pause
Make sure you have copied translation file too.
__________________
Taking paid private requests! Contact me
Cruze is online now
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 13:43.


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