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

[L4D2] - Problem in the .sp code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
weffer
Member
Join Date: Oct 2020
Old 02-12-2021 , 13:42   [L4D2] - Problem in the .sp code
Reply With Quote #1

Hello:

I would like to know why this code does not bring me the path of the sourcemod my OS is windows-

Sourcemod version : 1.10 - build 6502


Code :
-------
char sGameDir[32];
char sTranslationFile[PLATFORM_MAX_PATH];
char sTranslationLocation[PLATFORM_MAX_PATH];

Format(sTranslationFile, sizeof(sTranslationFile), "xxx.%s.phrases", sGameDir);

LogMessage("Loading translation file [%s].", sTranslationFile);
LogMessage("Folder: %s", sTranslationLocation);

Log:
-----
L 02/12/2021 - 13:28:57: [xxx.smx] Folder:
L 02/12/2021 - 13:28:57: [xxx.smx] Loading translation file [xxx.left4dead2.phrases].

Last edited by weffer; 02-12-2021 at 13:48.
weffer is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 02-12-2021 , 19:36   Re: [L4D2] - Problem in the .sp code
Reply With Quote #2

u don't have the xxx.left4dead2.phrases in the translation folder.

sourcemod/translations
__________________

Last edited by Marttt; 02-12-2021 at 19:37.
Marttt is offline
weffer
Member
Join Date: Oct 2020
Old 02-13-2021 , 23:07   Re: [L4D2] - Problem in the .sp code
Reply With Quote #3

If I have the file in that sourcemod / Translations path, but it doesn't identify it, check the code and update it to identify the path (LogMessage("Folder: %s", sTranslationLocation);)

LOG:
---
L 02/12/2021 - 13:28:57: Folder [xxx.smx]:

the log tells me that it arrives empty does not show the path of my sourcemod
weffer is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 02-14-2021 , 01:34   Re: [L4D2] - Problem in the .sp code
Reply With Quote #4

You don't need the path to SourceMod to load a translations file, just call
Code:
LoadTranslations(sTranslationFile);
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 02-14-2021 at 01:35.
DJ Tsunami is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 02-14-2021 , 03:07   Re: [L4D2] - Problem in the .sp code
Reply With Quote #5

Use the BuildPath function for formatting the file path.

PHP Code:
BuildPath(Path_SMsTranslationLocationsizeof(sTranslationLocation), "translations/%s"sTranslationFile); 
__________________
Psyk0tik is offline
weffer
Member
Join Date: Oct 2020
Old 02-16-2021 , 13:51   Re: [L4D2] - Problem in the .sp code
Reply With Quote #6

thanks!!
weffer is offline
Reply


Thread Tools
Display Modes

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 16:19.


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