open.mp forum
[Server] make vscode compiler rewrite actual file - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Support (https://forum.open.mp/forumdisplay.php?fid=12)
--- Thread: [Server] make vscode compiler rewrite actual file (/showthread.php?tid=2286)



make vscode compiler rewrite actual file - hiwyn - 2022-04-23

everytime i press F5 to compile a filterscript or a gamemode

it creates the .amx, but creates where i open the vscode



i mean, if i did:

cd sampserver && code .

if i open a file MISSIONS.pwn in sampserver/gamemodes

it will generate the amx in /home/sampserver instead of /home/sampserver/gamemodes



there is a way to instead of generate the amx there it get the file path (.pwn i'm editing) and creates the amx there rewriting the actual?



its boring, every time i edit a lib or a gm or a filterscript i got to move the amx after finish









I'm compiling it on linux with this: https://github.com/pawn-lang/compiler/releases

And with this .vscode/tasks.json:



Code:
{

? // See https://go.microsoft.com/fwlink/?LinkId=733558

? // for the documentation about the tasks.json format

? "version": "2.0.0",

? "tasks": [

? ? {

? ? ? "label": "build",

? ? ? "type": "shell",

? ? ? "command": "/usr/bin/pawncc",

? ? ? "args": [

? ? ? ? "${file}",

? ? ? ? "\"-;\"",

? ? ? ? "\"-(\"",

? ? ? ? "-i\"/home/hiwyn/Documents/sampserver/include/\""

? ? ? ],

? ? ? "group": {

? ? ? ? "kind": "build",

? ? ? ? "isDefault": true

? ? ? },

? ? ? "isBackground": false,

? ? ? "presentation": {

? ? ? ? "reveal": "silent",

? ? ? ? "clear": false,

? ? ? ? "panel": "dedicated"

? ? ? },

? ? ? "problemMatcher": [

? ? ? ? {

? ? ? ? ? "base": "$pawncc",

? ? ? ? ? "fileLocation": "relative"

? ? ? ? }

? ? ? ]

? ? }

? ]

}



RE: make vscode compiler rewrite actual file - hiwyn - 2022-05-12

just add
"'-D${fileDirname}'",
on task.json