• 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use SAMPCTL vscode/sublime.
#1
INTRODUCTION TO SAMPCTL

Sampctl?is like a node npm just like in node.js but its in pawn there are many compatible libraries aka includes, there are many reasons to use sampctl.

1st is the compiler for vscode and sublime it can support both editors.?

2nd you can install libraries/includes in just a line.

3rd you can say goodbye to server.cfg, in sampctl you will use pawn.json instead of server.cfg



INSTALLING SAMPCTL



There are 2 ways to install this (Actually there are 3 or smth).

First way is using SCOOP, (INSTALL SCOOP HERE?or just run?
Code:
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
) after that you can now you can execute this

Code:
scoop bucket add southclaws https://github.com/Southclaws/scoops.git; scoop install sampct


from another line. You can now run `sampctl` in PowerShell, CMD, git bash but you will need to restart any other open terminals if you install scoop for the first time so it is loaded in the the PATH environmet variable properly



The second way is installing it manually here are the steps.

1. Create a directory on your `c:\` drive root named `sampctl`

2. Download a Window release of sampctl and place the .exe file into the `sampctl` directory you created

3.?Add `c:\sampctl\` to your system PATH.

4. Open a new shell (PowerShell, CMD, or bash) and type `sampctl` - if you did the above correctly, you'll see sampctl help.





USING SAMPCTL



?1. How to install sampctl to your gamemode.?

Open up PowerShell or CMD in your server files directory (Where samp-server.exe and server.cfg located) use `sampctl p init` and you'll see this.

[Image: imLKAR2.png?1]


i never used .yaml im only using .json so select what you want here and you need to give information for your gamemode/library like if you want it to release to Github.



Now it will gonna ask you if you want to publish a gamemode/library like this.

[Image: nNHalYm.png?1]

Library means if you want to create a reusable includes this is where the fun begins, if you create a Library using sampctl we can download that using one command line which we will cover later.



Now you can select your Text editor you'll see an option like this.

[Image: b26GovK.png?1]

You can go select any Text editors you want (vscode or Sublime) for me I'm gonna select VScode for this.



Then lastly you're gonna select your main .pwn file

[Image: VA4bFrH.png?1]


IT MUST BE YOUR MAIN .PWN FILE but don't worry you will be able to change this in your pawn.json HAHA now you're done. If you're using vscode you can simply do ctrl shift b to compile your script I think the same goes to Sublime



2. How to install dependencies.

Well you can only install dependencies compatible or made with sampctl you've seen an option there earlier in the tutorial with the selection "gamemode / library" if you create a library you can just simply install it in your gamemode with just 1 line

`sampctl p install` so for instance `sampctl p install CnRXomoX/X_Enex` now some of you are asking "How did he get the link"(Assuming you're asking) well its pretty easy you can take a look at this picture


[Image: i06WID9.png?1]

Do you see the difference? you can enter it without the github.com because sampctl automatically adds it without hesitation downloading it 1 by 1 and this is the fun thing about sampctl it automatically downloads the .dll file or .so files automatically!

So no need to search "How to fix .dll error samp script".



You can see your downloaded libraries/includes in your dependency folder

If you just cloned your gamemode onto another PC/LAPTOP you can run `sampctl p ensure` to download the libraries/includes that is in your dependencies folder and .dll files in your plugins!



Sources.

sampctl GitHub repo:?https://github.com/Southclaws/sampctl

sampctl .exe file:?https://github.com/sampctl/installer/releases

You can go visit the GitHub repo for additional information




[img]https://i.imgur.com/nNHalYm.png?1[/img
  Reply


Messages In This Thread
How to use SAMPCTL vscode/sublime. - by XoMoX - 2020-10-19, 10:01 AM

Forum Jump: