• 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
#2
sampctl is really perfect.

Nice tutorial.
  • Open.MP

  • SA-MP

  • C/C?

  • C# .NET

  • JS


?

Programming this and that..





"?A minute?s success pays the failure of years?"

?



  Reply
#3
Sorry I don't know how to compile it with the help of SAMPCTL in sublime. can you show me how? how do I set it?
  Reply
#4
(2021-04-03, 02:55 PM)PutuSuhartawan Wrote: Sorry I don't know how to compile it with the help of SAMPCTL in sublime. can you show me how? how do I set it?



Hey. You can simply open your terminal (Whatever you use, PowerShell, CMD, Git etc...). Then run sampctl p build?and to ensure that all the dependencies are installed, run sampctl p ensure, also make sure you run sampctl p build inside your server directory.



And Good Tutorial.
  Reply
#5
sorry, how do I set the location of the folders and files that will be compiled with sampctl? Previously I had a problem because when I built the gamemode that was compiled the name was not the same. instead it becomes emty.pwn and .amx is also empty. thank you?
  Reply
#6
(2021-04-06, 10:27 AM)PutuSuhartawan Wrote: sorry, how do I set the location of the folders and files that will be compiled with sampctl? Previously I had a problem because when I built the gamemode that was compiled the name was not the same. instead it becomes emty.pwn and .amx is also empty. thank you?



Just create a new folder wherever you want it to be, open the folder with VSC then use sampctl p init to turn it into a gamemode directory.
  Reply
#7
i known some cmds like sampctl package install / sampctl p run / sampctl package init, can someone release all cmds?
  Reply
#8
(2021-04-13, 09:26 PM)Nightmare Wrote: i known some cmds like sampctl package install / sampctl p run / sampctl package init, can someone release all cmds?



Hey. Check out this page.?https://github.com/Southclaws/sampctl/wiki
  Reply


Forum Jump: