Closed moemoequte closed 1 year ago
Hi, thanks for reporting the issue! Can you please post the code via text (whole project ideally) so that I can try to reproduce the error?
I assume that POSTGRESQL_ROOT_DB
and ...SHOP_PLAYER
are defines, which can cause a problem for the parser if the preprocessor did not work properly.
You can also try the Reveal preprocessed document (as seen by the server)
command (CTRL+SHIFT+P and type Reveal preprocessed document (as seen by the server)
) This should show what the parser sees and the syntax error will be apparent.
Hi, thanks for reporting the issue! Can you please post the code via text (whole project ideally) so that I can try to reproduce the error?
I assume that
POSTGRESQL_ROOT_DB
and...SHOP_PLAYER
are defines, which can cause a problem for the parser if the preprocessor did not work properly.You can also try the
Reveal preprocessed document (as seen by the server)
command (CTRL+SHIFT+P and typeReveal preprocessed document (as seen by the server)
) This should show what the parser sees and the syntax error will be apparent.
test.inc
#define URL "url"
#define PLAYER "player"
temp2.sp
#include <sourcemod>
#include <test>
#pragma semicolon 1
#pragma newdecls required
public void OnPluginStart()
{
char url[256];
Format(url, sizeof(url), "%s/%s,%d", URL, PLAYER, 5);
}
ERROR:
Compile log
C:\Users\cialloo\sourcemodAPI\addons\sourcemod\scripting\spcomp.exe
c:\Users\cialloo\Desktop\backend\addons\sourcemod\scripting\temp2.sp
-oc:\Users\cialloo\Desktop\backend\addons\sourcemod\plugins\temp2.smx
-ic:\Users\cialloo\Desktop\backend\addons\sourcemod\scripting\include
-ic:\Users\cialloo\Desktop\backend\addons\sourcemod\scripting
-ic:\Users\cialloo\Desktop\backend\addons\sourcemod\scripting\include
-iC:\Sourcemod\include
-O2 -v2
SourcePawn Compiler 1.11.0.6934
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2021 AlliedModders LLC
Code size: 3676 bytes
Data size: 2304 bytes
Stack/heap size: 16732 bytes
Total requirements: 22712 bytes
Done.
Basic informations
Further Information
When I use
FormatEx()
like thisit will shows an error, I dont know what this error means
After I delete the
FormatEx()
function, vscode will not shows the errorBut I can compile this code although the plugin tells me there is an error
I use one line the error still occurs
When code is very simple, the
Format
behave correct