SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/10/2017, 04:39 AM   #31
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 630
Reputation: 87
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by friderik View Post


I've done everything, run VSC from shortcut and new folder doesn't appear.
Are you talking about the .vscode folder? Check the program itself and it should be at the very top on the left hand side tab. If not, try to open your server folder with "Open Folder" from the "File" menu. This should definitely create the folder.
FreAkeD is offline   Reply With Quote
Old 06/10/2017, 11:44 AM   #32
OneDay
Huge Clucker
 
Join Date: Sep 2015
Posts: 294
Reputation: 139
Default Re: PAWN Syntax and Compiler for Visual Studio Code

I think it has not "state" or "#else".
OneDay is offline   Reply With Quote
Old 06/10/2017, 01:27 PM   #33
friderik
Little Clucker
 
Join Date: Oct 2017
Posts: 16
Reputation: 0
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by FreAkeD View Post
Are you talking about the .vscode folder? Check the program itself and it should be at the very top on the left hand side tab. If not, try to open your server folder with "Open Folder" from the "File" menu. This should definitely create the folder.
I swear to god I tried everything, still new .vscode folder doesn't appear..

friderik is offline   Reply With Quote
Old 06/10/2017, 01:49 PM   #34
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 630
Reputation: 87
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by friderik View Post
I swear to god I tried everything, still new .vscode folder doesn't appear..
Try this:

Make sure you do this when your server folder is fully opened. Go to File > Preferences > Settings. Then check the left sidebar, this should definitely create a folder for you because it will create a settings.json file along with it.
FreAkeD is offline   Reply With Quote
Old 06/10/2017, 04:18 PM   #35
friderik
Little Clucker
 
Join Date: Oct 2017
Posts: 16
Reputation: 0
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by FreAkeD View Post
Try this:

Make sure you do this when your server folder is fully opened. Go to File > Preferences > Settings. Then check the left sidebar, this should definitely create a folder for you because it will create a settings.json file along with it.
Finally, I've found that.. it hides in C/USERS so I had to move it. Anyway it works, thanks!
friderik is offline   Reply With Quote
Old 30/10/2017, 02:06 PM   #36
Diablosrouge
Huge Clucker
 
Diablosrouge's Avatar
 
Join Date: Jul 2007
Location: Portugal
Posts: 467
Reputation: 84
Default Re: PAWN Syntax and Compiler for Visual Studio Code

This looks neat. What about the function list tho?
Is it possible to integrate it in Visual Studio just like PAWN has? A list with all the functions and if you double-click it, it will insert the function and its parameters in the code.
__________________
Diablosrouge is offline   Reply With Quote
Old 31/10/2017, 09:53 AM   #37
CXdur
Big Clucker
 
CXdur's Avatar
 
Join Date: Jun 2014
Location: Norway
Posts: 57
Reputation: 6
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by Diablosrouge View Post
This looks neat. What about the function list tho?
Is it possible to integrate it in Visual Studio just like PAWN has? A list with all the functions and if you double-click it, it will insert the function and its parameters in the code.
You can use the command palette to open such a list, but for me I barely ever use the insert snippet function. Intellisense really makes this function obsolete, at least to me as I remember all the functions, but if I were to create my own custom snippets for my own gamemode functions (which there are tons of and not all of them are easy to remember) I suppose it would come in handy.

Anyhow, you can bring up the command palette to and search for Insert Snippet to bring up this:


You can also bind this to a key so you don't have to bring up the command palette and search for it, using the following command:

Code:
"command": "editor.action.insertSnippet"
Changing keybindings is pretty easy to do in VSCode and I'm sure you'll understand the basics of it.

The list of snippets will look like this:

CXdur is offline   Reply With Quote
Old 01/11/2017, 09:24 AM   #38
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 630
Reputation: 87
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Very nice stuff, @CXdur.

I'll be working on updating the tutorial for much better readability and add some useful snippets into it too.
FreAkeD is offline   Reply With Quote
Old 01/11/2017, 12:51 PM   #39
CXdur
Big Clucker
 
CXdur's Avatar
 
Join Date: Jun 2014
Location: Norway
Posts: 57
Reputation: 6
Default Re: PAWN Syntax and Compiler for Visual Studio Code

Quote:
Originally Posted by FreAkeD View Post
Very nice stuff, @CXdur.

I'll be working on updating the tutorial for much better readability and add some useful snippets into it too.
I created a quick java program to generate snippets for me so that I could easily add some snippets for my gamemode's functions. Here is a pastebin link if anyone is interested:

https://pastebin.com/p7n6uH2H

It should be pretty simple to use, just put it in a folder and create a .txt file called "resources.txt", you can see a sample below. You will need to compile the file and launch it (javac filename & java filename, might need to use the filepaths to javac.exe/java.exe if you don't have the environment variables set up). Alternatively, you can install the Code Runner extension for VScode which is far more simple.

Example resources.txt
Code:
ApplyEventVehicleSettings(playerid, vehicle)
ApplyEventVehicleEnter(playerid, vehicle)
SendHostMessageToEventMembers(event, text[])
AddGroupDrugDepot(const groupId, const dbId, Float:x, Float:y, Float:z, interior, world, drugAmount = 7500, playerLimit = 150, rank = 1, drugbag = false)
IsNearbyGroupWeaponRack(const playerid, const wepRack)
And this is the output.json after running the program:
Code:
"ApplyEventVehicleSettings": {
	"prefix": "ApplyEventVehicleSettings",
	"body": "ApplyEventVehicleSettings(${1:playerid}, ${2: vehicle})$0"
},
"ApplyEventVehicleEnter": {
	"prefix": "ApplyEventVehicleEnter",
	"body": "ApplyEventVehicleEnter(${1:playerid}, ${2: vehicle})$0"
},
"SendHostMessageToEventMembers": {
	"prefix": "SendHostMessageToEventMembers",
	"body": "SendHostMessageToEventMembers(${1:event}, ${2: text[]})$0"
},
"AddGroupDrugDepot": {
	"prefix": "AddGroupDrugDepot",
	"body": "AddGroupDrugDepot(${1:const groupId}, ${2: const dbId}, ${3: Float:x}, ${4: Float:y}, ${5: Float:z}, ${6: interior}, ${7: world}, ${8: drugAmount = 7500}, ${9: playerLimit = 150}, ${10: rank = 1}, ${11: drugbag = false})$0"
},
"IsNearbyGroupWeaponRack": {
	"prefix": "IsNearbyGroupWeaponRack",
	"body": "IsNearbyGroupWeaponRack(${1:const playerid}, ${2: const wepRack})$0"
},
CXdur is offline   Reply With Quote
Old 01/11/2017, 05:31 PM   #40
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 408
Reputation: 32
Default Re: PAWN Syntax and Compiler for Visual Studio Code

I put the shortcut in my server folder, i run it but doesn't generate any .vscode folder. How to fix this? I tried around 30 mins but nothing
Banditul18 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 7 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 03:49 AM.


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