[Tutorial] PAWN Syntax and Compiler for Visual Studio Code
#21

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.
Reply
#22

I think it has not "state" or "#else".
Reply
#23

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..

Reply
#24

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.
Reply
#25

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!
Reply
#26

Very nice stuff, @CXdur.

I'll be working on updating the tutorial for much better readability and add some useful snippets into it too.
Reply
#27

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"
},
Reply
#28

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
Reply
#29

@Banditul try another think: open vs code, click File, Open Folder... and select your server folder. After vs code load everythink go to Tasks -> Configure Tasks. (worked for me)
Reply
#30

Quote:
Originally Posted by 10MIN
View Post
@Banditul try another think: open vs code, click File, Open Folder... and select your server folder. After vs code load everythink go to Tasks -> Configure Tasks. (worked for me)
Works thanks m8 and no errors from ysi
Reply
#31

helpm i'm br

on debug



help
Reply
#32

Ran into a problem:
Code:
> Executing task in folder 0.3.8 RP: I:\0.3.8 RP\pawno\pawncc.exe gamemodes/rp.pwn < 'I:\0.3.8' is not recognized as an internal or external command, operable program or batch file. The terminal process terminated with exit code: 1 Terminal will be reused by tasks, press any key to close it.
Reply
#33

Those suggested flags for VSC do not work for me when trying to compile the latest YSI version 4.0.1.
I've added "#pragma semicolon 1" to the script, and now it compiles. (Just in case anyone else has this problem in the future)
Reply
#34

Quote:
Originally Posted by PaulDinam
View Post
Ran into a problem:
Code:
> Executing task in folder 0.3.8 RP: I:\0.3.8 RP\pawno\pawncc.exe gamemodes/rp.pwn < 'I:\0.3.8' is not recognized as an internal or external command, operable program or batch file. The terminal process terminated with exit code: 1 Terminal will be reused by tasks, press any key to close it.
Change command key in tasks.json become like this:

Code:
"command": "\"${workspaceRoot}\"\\pawno\\pawncc.exe =)+ -;+"
This because your PAWNO path has a space character and read as arguments.
Reply
#35

very good my friend.
stop, there are no versions for 32 bits? I have 32 bits
Reply
#36

Quote:
Originally Posted by Daniielk
View Post
very good my friend.
stop, there are no versions for 32 bits? I have 32 bits
https://code.visualstudio.com/download
As far i can see there is 32 bits versions
Reply
#37

Quote:
Originally Posted by Banditul18
View Post
https://code.visualstudio.com/download
As far i can see there is 32 bits versions
Oh, thanks man
Reply
#38

Ok, I have tried a couple of things to myke VCS work with YSI 4.0.1, but none work (see below). Where exactly do I put "=)+" and "-;+"?

Code:
"args": [
        "${relativeFile}",
        "=)+",
        "-;+"
    ],
Code:
"windows":  
    {  
        "command": "${workspaceRoot}\\pawno\\pawncc.exe =)+ -;+"
    },
__________________________________________________ _____________________________________

EDIT: Forget about the above, it isn't even needed. Add "#pragma semicolon 1" to the top of your script and the latest YSI compiles fine.
Reply
#39

pawn Code:
> Executing task in folder .vscode: c:\Users\Nevinn\Desktop\HC-RP Offical Release\0.3.8 RC4-4\gamemodes\.vscode\pawno\pawncc.exe ../Hard Core.pwn <

c:\Users\Nevinn\Desktop\HC-RP : The term 'c:\Users\Nevinn\Desktop\HC-RP' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ c:\Users\Nevinn\Desktop\HC-RP Offical Release\0.3.8 RC4-4\gamemodes\. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\Users\Nevinn\Desktop\HC-RP:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task in folder .vscode: c:\Users\Nevinn\Desktop\HC-RP Offical Release\0.3.8 RC4-4\gamemodes\.vscode\pawno\pawncc.exe ../Hard Core.pwn <

c:\Users\Nevinn\Desktop\HC-RP : The term 'c:\Users\Nevinn\Desktop\HC-RP' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ c:\Users\Nevinn\Desktop\HC-RP Offical Release\0.3.8 RC4-4\gamemodes\. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\Users\Nevinn\Desktop\HC-RP:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Error.
Reply
#40

Your ******* tutorial?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)