[Tutorial] PAWN Compiler in SublimeText 2 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (
https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] PAWN Compiler in SublimeText 2 (
/showthread.php?tid=304603)
PAWN Compiler in SublimeText 2 -
Faw - 19.12.2011
Hi friends,
SublimeText 2 is a powerful text editor, like notepad++ for example, but better, i think.
It's possible to create some plugins with python language.
So, i've created a small script for compile a PAWN script with sublimetext.
How to proceed ?
Step 1 : On the menu >>
Tools ->
New Plugin...
Step 2 : In the new window, you need to put the script :
PHP код:
import sublime, sublime_plugin
import os
class PawnoCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().run_command('pawno_compile')
class PawnoCompileCommand(sublime_plugin.WindowCommand):
def run(self):
filePath = self.window.active_view().file_name()
dirName = os.path.dirname(filePath);
os.system("C:\path\to\pawncc.exe \""+filePath+"\" -D\""+dirName+"\" & pause");
Gist :
link
You need to replace "C:\path\to\pawncc.exe" by your pawncc.exe path.
Step 3 : Now we need to create the shortcut for execute the compilation.
So :
Preferences ->
Key Bindings - User and add this line :
Код:
{ "keys": ["ctrl+shift+p"], "command": "pawno" }
Step 4 : Save all!
Now when you want to compile your script, you have just to press
ctrl+shift+p
I hope this tutorial can help somebody.
PS : I'm sorry for my english, i'm french so if you see many mistakes i'm sorry. You can correct me, for make my english better!
Re: PAWN Compiler in SublimeText 2 - T0pAz - 19.12.2011
Nice tip!