SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 15/08/2017, 11:53 AM   #21
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 586
Reputation: 132
Default Re: PAWN Syntax and Compiler for Visual Studio Code

@FreAkeD Great, this is perfection. Thank you.
iKarim is offline   Reply With Quote
Old 22/08/2017, 03:52 PM   #22
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italia
Posts: 1,362
Reputation: 85
Default Re: PAWN Syntax and Compiler for Visual Studio Code

OMG thank you!
I was going to create these extensions as I know Visual Studio Code is the perfect scripting environment for many situations, but thanks to this thread I discovered that it already exists. I'll check it out today.
Sasino97 is offline   Reply With Quote
Old 22/08/2017, 03:59 PM   #23
Xeon™
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 530
Reputation: 96
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by Sasino97 View Post
OMG thank you!
I was going to create these extensions as I know Visual Studio Code is the perfect scripting environment for many situations, but thanks to this thread I discovered that it already exists. I'll check it out today.
****** translate detected.

@OP: Good job, nice tutorial
Xeon™ is offline   Reply With Quote
Old 23/08/2017, 06:32 PM   #24
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italia
Posts: 1,362
Reputation: 85
Exclamation Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by XeonMaster View Post
****** translate detected.

@OP: Good job, nice tutorial
I never use Go0gle Translate to write my posts, and yes, I know my English sounds weird.

----------------------------------------------------------------

I want people to notice that you don't have to make a shortcut to Visual Studio Code inside your workspace, it's not needed as long as you open it with "Open Folder" from the File menu. This option will automatically create a .vscode folder inside your working directory.

As an extra, you could add a task to start the sa-mp server directly inside the IDE:
tasks.json
PHP Code:
{
    
"version""2.0.0",
    
"tasks": [
        {
            
"taskName""PawnBuild",
            
"type""shell",
            
"args":[
                
"=)+",
                
"-;+",
                
"${relativeFile}"
            
],
            
"windows": {
                
"command""${workspaceRoot}\\pawno\\pawncc.exe"
            
},
            
"group": {
                
"kind""build",
                
"isDefault"true
            
}
        },
        {
            
"taskName""SampServer",
            
"type""shell",
            
"windows": {
                
"command""${workspaceRoot}\\samp-server.exe"
            
}
        }
    ]

keybindings.json
PHP Code:
    {
        
"key""f5",
        
"command""workbench.action.tasks.runTask",
        
"args""SampServer"
    


Last edited by Sasino97; 23/08/2017 at 07:06 PM.
Sasino97 is offline   Reply With Quote
Old 24/08/2017, 11:01 AM   #25
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 650
Reputation: 82
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by Sasino97 View Post
I want people to notice that you don't have to make a shortcut to Visual Studio Code inside your workspace, it's not needed as long as you open it with "Open Folder" from the File menu. This option will automatically create a .vscode folder inside your working directory.
I remember trying it that way and it didn't work, seems like it does then, thats good to know. I'll update the topic asap then .
FreAkeD is offline   Reply With Quote
Old 07/09/2017, 08:49 PM   #26
CXdur
Little Clucker
 
CXdur's Avatar
 
Join Date: Jun 2014
Location: Norway
Posts: 43
Reputation: 4
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Does anyone know what is wrong here?

Code:
{ 
    "version": "2.0.0",  
    "type": "shell", 
    "args":[ 
        "${relativeFile}",
        "-;+",
        "-(+",
        "v2",
        "d2",
        "-i${workspaceRoot}/pawno/include"
    ],
    "windows":  
    {  
        "command": "${workspaceRoot}\\pawno\\pawncc.exe"  
    },
    "group": {
        "kind": "build",
        "isDefault": true
    }
}
Here is the log:

Code:
> Executing task: c:\Users\sondr\git\lsrcr\pawno\pawncc.exe gamemodes/lsrcr.pwn -;+ -(+ v2 d2 -ic:\Users\sondr\git\lsrcr/pawno/include <

At line:1 char:70
+ ... \sondr\git\lsrcr\pawno\pawncc.exe gamemodes/lsrcr.pwn -;+ -(+ v2 d2 - ...
+                                                                  ~
Missing expression after unary operator '+'.
At line:1 char:71
+ ... ndr\git\lsrcr\pawno\pawncc.exe gamemodes/lsrcr.pwn -;+ -(+ v2 d2 -ic: ...
+                                                                ~~
Unexpected token 'v2' in expression or statement.
At line:1 char:70
+ ... \sondr\git\lsrcr\pawno\pawncc.exe gamemodes/lsrcr.pwn -;+ -(+ v2 d2 - ...
+                                                                  ~
Missing closing ')' in expression.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingExpressionAfterOperator

The terminal process terminated with exit code: 1
CXdur is offline   Reply With Quote
Old 12/09/2017, 08:27 PM   #27
CXdur
Little Clucker
 
CXdur's Avatar
 
Join Date: Jun 2014
Location: Norway
Posts: 43
Reputation: 4
Default Re: PAWN Syntax and Compiler for Visual Studio Code

The previous errors are now solved, but instead I'm getting another weird error.

Does anyone have any idea why it fails to read from these files? If I compile in atom it can read from them without issues.

Code:
Executing task: c:\Users\sondr\git\lsrcr/pawno/pawncc.exe gamemodes/lsrcr.pwn -; -( -v2 -ic:\Users\sondr\git\lsrcr/pawno/include <

Pawn compiler 3.10.20160907                     Copyright (c) 1997-2006, ITB CompuPhase

gamemodes/lsrcr.pwn(47) : fatal error 100: cannot read from file: "global/objects.pwn"

Compilation aborted.
Here is my build task:

Code:
{ 
    "version": "2.0.0",  
    "type": "process",
    "args":[ 
        "${relativeFile}",
        "-;",
        "-(",
        "-v2",
        "-i${workspaceRoot}/pawno/include"       
    ],
    "windows":  
    {  
        "command": "${workspaceRoot}/pawno/pawncc.exe"  
    },
    "group": {
        "kind": "build",
        "isDefault": true
    }
}
CXdur is offline   Reply With Quote
Old 05/10/2017, 11:45 AM   #28
friderik
Little Clucker
 
Join Date: Oct 2017
Posts: 16
Reputation: 0
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Setting up the compiler doesn't work for me, I tried making a shortcut and directly choosing whole server folder in VSC.

Can somebody help somehow?
friderik is offline   Reply With Quote
Old 05/10/2017, 02:00 PM   #29
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 650
Reputation: 82
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by friderik View Post
Setting up the compiler doesn't work for me, I tried making a shortcut and directly choosing whole server folder in VSC.

Can somebody help somehow?
You've definitely missed a step or done something wrong. Give it another try.
FreAkeD is offline   Reply With Quote
Old 05/10/2017, 04:37 PM   #30
friderik
Little Clucker
 
Join Date: Oct 2017
Posts: 16
Reputation: 0
Default Re: PAWN Syntax and Compiler for Visual Studio Code



I've done everything, run VSC from shortcut and new folder doesn't appear.
friderik is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Visual Studio Code Compiler Casttiel Lançamentos/Releases 7 17/08/2017 08:18 AM
Can someone make Pawn compiler for Visual Studio Code? DuyDang2412 Scripting Help 11 26/07/2017 11:21 AM
[Tutorial] Visual Studio like an compilator PAWN language Dystans Tutorials 9 17/02/2013 06:43 AM
Visual Studio as the development environment for PAWN Arca Scripting Help 7 28/07/2012 08:18 PM
PawnCC (Pawn Code Compiler) Crashes. Ash. Help Archive 4 28/07/2010 10:25 AM


All times are GMT. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.