SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Tutorials (https://forum.sa-mp.com/forumdisplay.php?f=70)
-   -   [Tutorial] PAWN for SA-MP in Sublime Text 3 (https://forum.sa-mp.com/showthread.php?t=626423)

PeanutButter 14/01/2017 10:58 PM

PAWN for SA-MP in Sublime Text 3
 
PAWN for SA-MP in Sublime Text 3


About

Sublime Text 3 is a highly customizable Text-editor with a lot of cool features, that you don't get using the standard Pawno-editor or Notepad++. I know there are already a bunch of tutorials about this, but they don't explain how to install packages very well, which can be confusing for beginners and I added some instructions on using the program.
  • You can fully customize the editor to something you feel comfortable with.
  • Writing code is faster because of the auto-completion and a smart auto-correction.
  • Your code will look a lot cleaner with the neat indentation it offers.
  • A lot of useful (customizable) Keyboard Shortcuts to write code more easily.
  • It also works for a lot of other languages, so it can be used as your primary text editor.
  • Sublime Text is available for Windows, OS X and and Linux.

Features

Auto-completion

http://i.imgur.com/J1l6xzj.gif




Some pre-made Color Schemes

http://i.imgur.com/YRNN0uW.png
http://i.imgur.com/JmP759i.png
http://i.imgur.com/3UhjvN7.png




Some pre-made shortcuts

http://docs.sublimetext.info/en/late...tcuts_win.html



Installing

Downloads
Click here - Download and Install the latest Sublime Text
Click here - Download the Package Control file for sublime


Installing the syntax
  1. Download and Install Sublime Text
  2. Download the Package Control file
  3. Paste the Package Control file into C:\Users\Your PC Username\AppData\Roaming\Sublime Text 3\Installed Packages
  4. Open Sublime Text 3 - or restart if already open
  5. Go to Preferences>Package Control and choose Install Package and wait until a new window pops up
  6. Search for pawn and click on Pawn Syntax, wait until it's installed
  7. You can now change the syntax to PAWN in the Lower right corner or View>Syntax>Pawn

You can now start writing SendClientMessage to see if the auto-completion works. If it doesn't you didn't complete these steps successfully.

Installing the compiler
  1. Go to Tools>Build System>New Build System
  2. Replace the code with this code:
    Code:

    {
            "cmd": ["pawncc.exe", "-i includes", "$file", "-;+"],
            "path": "C:/path/to/pawno/folder"
    }

  3. You have to change the path to the folder containing pawncc.exe (e.g. "C:/Users/Name/Desktop/MyServer/pawno"), make sure the slashes from your path are / and not \.
  4. Save the file (remember the name) and close the tab
  5. Restart the program
  6. Set your build system: Tools>Build System>name you chose
  7. You can now press Ctrl+B to compile the the code.

Congratulations, you're done



Extra instructions

How can I change the compile button?
  1. Go to Preferences>Key Bindings
  2. Search for build with Ctrl+F
  3. You can replace the current key with something new (e.g. F5)
    You should see something like this:
    Code:

    { "keys": ["ctrl+b"], "command": "build" },
  4. Save the file and restart Sublime Text 3


How can I change the color scheme?
  1. Go to Preferences>Color Scheme
  2. Try out some color schemes. Not satisfied? Go to the next quesion...

How can I get new color schemes?
  1. Go to Preferences>Package Control and choose Install Package
  2. You can search for color schemes between these packages

Indentation
  • Go to View>Indentation
    I recommend Tab Width 4
  • You can adjust the indentation by selecting the line(s) and pressing Ctrl+[ and Ctrl+].
    Or with the Tab button.
http://i.imgur.com/9ZpDtPa.gif


More tips

11 Sublime Text Tips for Productivity and a Faster Workflow

Eoussama 14/01/2017 11:06 PM

Re: PAWN for SA-MP in Sublime Text 3
 
As a regular sublime text user, I really think people should consider using this editor,
Nice explanation, I remember having trouble back when I first intended to install sublime text, there was really no accurate tutorials on how to do it

princejeet1510 15/01/2017 04:39 AM

Re: PAWN for SA-MP in Sublime Text 3
 
Nice one mate TBH didn't noticed that it exists though and have much good shit in it as you explained...
+1
PS: please help me out the compiling part doesn't work.
And please tell that should I place pawncc.exe file the game mode or the all files of pawno folder.

Eloy 16/01/2017 02:56 AM

Respuesta: PAWN for SA-MP in Sublime Text 3
 
Good tutorial, i love sublime text 3, Good Post

View 16/01/2017 11:40 AM

Re: PAWN for SA-MP in Sublime Text 3
 
What I did wrong?

PHP Code:


__init__
() got an unexpected keyword argument 'Cmd' 


PeanutButter 16/01/2017 04:42 PM

Re: PAWN for SA-MP in Sublime Text 3
 
Quote:

Originally Posted by View (Post 3829120)
What I did wrong?

PHP Code:


__init__
() got an unexpected keyword argument 'Cmd' 


There is a problem in your build system (compiler)
You wrote Cmd instead of cmd.

It should look like this:
Code:

{
        "cmd": ["pawncc.exe", "-i includes", "$file", "-;+"],
        "path": "C:/path/to/pawno/folder"
}

To fix it you have to edit the file that you made, located in:
C:\Users\YOUR PC USERNAME HERE\AppData\Roaming\Sublime Text 3\Packages\User
and Change Cmd to cmd

PeanutButter 16/01/2017 06:00 PM

Re: PAWN for SA-MP in Sublime Text 3
 
Quote:

Originally Posted by princejeet1510 (Post 3828587)
PS: please help me out the compiling part doesn't work.
And please tell that should I place pawncc.exe file the game mode or the all files of pawno folder.

Which part isn't working?
Actually it doesn't really matter where your pawncc.exe is. Just make sure that the path is correct.

If for example this is the location of pawncc.exe:
C:\Users\name\Desktop\MyServer\pawno\pawncc.exe

Then this should be your path:
C:/Users/name/Desktop/MyServer/pawno

So the path that you have to write for you build file doesn't have \ but /
and the path does not end with pawncc.exe

View 16/01/2017 07:23 PM

Re: PAWN for SA-MP in Sublime Text 3
 
Perfect , Thank you.

Dayrion 17/01/2017 10:14 PM

Re: PAWN for SA-MP in Sublime Text 3
 
Anyone know who can we get this ?
I'm using Sulime Text since some times and never finnd it : https://gyazo.com/8d45f23521877f7eb07dac9e490d441d

Yaa 17/01/2017 10:38 PM

Re: PAWN for SA-MP in Sublime Text 3
 
i love you man, i was searching for this from a lonnnnnnnnnnnng time THANKS
+REP


All times are GMT. The time now is 10:09 PM.

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