17.08.2015, 18:56
First of all, this is a very specific tutorial, focused on people who use to work on OSX with IntelliJ. This tutorial does not exclude the fact you'll have to install a Windows VM on OSX, since pawn compiler sa-mp uses only works on Windows.
Requirements
- Parallels or VirtualBox. Download it at: http://www.parallels.com/br/products/desktop/
- A working Windows VM (XP, Vista, 7 or 10) built in Parallels, Wine or similar with network shared with OSX. (my parallels version: 10.2.2. In this tutorial I'm using a Windows 7 VM with Parallels Tools installed.
- IntelliJ IDEA (mine is 13.1.4). Downloat Community Edition at: https://www.jetbrains.com/idea/download/
- MobaSSH installed on Windows. Download Home Edition at: http://mobassh.mobatek.net/download.html
Windows VM installation on Parallels
- Open Parallels and press command + N.
- Select Modern.IE as the new Virtual Machine. https://www.dropbox.com/s/u2v331tlb6...36.29.png?dl=0
- Keep clicking in "Continue" until you reach a window asking you to select the version of the system you want. Select "IE 11 in Windows 7". https://www.dropbox.com/s/cakcnre7nd...37.14.png?dl=0
- Download and install.
Windows VM installation on VirtualBox
- Download Modern.IE 11 on Windows 7 at http://dev.modern.ie/tools/vms/mac/
- On VirtualBox, go to File > Import Appliance and import the appliance you downloaded.
Parallels network configuration
Create two network configurations configured as the images below:
https://www.dropbox.com/s/ms0pac4wc2...21.58.png?dl=0
https://www.dropbox.com/s/79ksqy51sj...23.49.png?dl=0
VirtualBox network configuration
- First you need to create a new host-only network on VirtualBox, so open VirtualBox and press the shortcut Command + comma (Settings), then go to Network > Host-only network and click the icon "New" on the right panel. https://www.dropbox.com/s/14wj6fpyp8...56.52.png?dl=0
- After creating vboxnet0, edit it with the following configuration:
https://www.dropbox.com/s/hzunha3fv4...33.48.png?dl=0
https://www.dropbox.com/s/zit9u53okv...34.03.png?dl=0
Windows Network Configuration
After installing and launching Windows, go to "Control Panel" > "Network and Sharing Center" > "Change Adapter Settings" > "Local area connection" > "Edit" > "Internet Protocol Version 4 (IPv4)" and configure it as the image below to configure Windows network to use static IP address.
https://www.dropbox.com/s/7pybkgmb8c...04.06.png?dl=0
MobaSSH
On the Windows VM, download and install MobaSSH (http://mobassh.mobatek.net/download.html)
IntelliJ IDEA Deployment configuration
On IntelliJ, configure the deployment as the images below:
https://www.dropbox.com/s/1d1hw8o4yp...13.34.png?dl=0
https://www.dropbox.com/s/4w2o3uuuis...17.08.png?dl=0
Check the option "automatic upload"
https://www.dropbox.com/s/lvpe4y5o0v...18.20.png?dl=0
On deployment options, check the option "Upload external changes" and remove ".git" and ".svn" from the excluded items by name.
https://www.dropbox.com/s/2daom83x2h...19.43.png?dl=0
Setting up IntelliJ IDEA custom external tool to compile the pawn script
Create a new External Tool with the following configuration
https://www.dropbox.com/s/letyfefide...22.36.png?dl=0
Change "Program" and "Working directory" paths. You'll also need to create a file called pawncompiler.sh on "Program" directory with the following content:
Create a shortcut to your new external tool:
https://www.dropbox.com/s/x83hbizj9u...28.27.png?dl=0
In this example I created the shortcut Command + \, but you can also configure IntelliJ to call the Pawn Compiler tool when you save the file (Command + S).
And finally, the result: (click on the ******* link to view it better)

https://www.youtube.com/watch?v=_4CEfHDYU9M
Pros
The tutorial can be incomplete, maybe I miss one step or another.. let me know if you follow this tutorial and couldn't start scripting on OSX!
Requirements
- Parallels or VirtualBox. Download it at: http://www.parallels.com/br/products/desktop/
- A working Windows VM (XP, Vista, 7 or 10) built in Parallels, Wine or similar with network shared with OSX. (my parallels version: 10.2.2. In this tutorial I'm using a Windows 7 VM with Parallels Tools installed.
- IntelliJ IDEA (mine is 13.1.4). Downloat Community Edition at: https://www.jetbrains.com/idea/download/
- MobaSSH installed on Windows. Download Home Edition at: http://mobassh.mobatek.net/download.html
Windows VM installation on Parallels
- Open Parallels and press command + N.
- Select Modern.IE as the new Virtual Machine. https://www.dropbox.com/s/u2v331tlb6...36.29.png?dl=0
- Keep clicking in "Continue" until you reach a window asking you to select the version of the system you want. Select "IE 11 in Windows 7". https://www.dropbox.com/s/cakcnre7nd...37.14.png?dl=0
- Download and install.
Windows VM installation on VirtualBox
- Download Modern.IE 11 on Windows 7 at http://dev.modern.ie/tools/vms/mac/
- On VirtualBox, go to File > Import Appliance and import the appliance you downloaded.
Parallels network configuration
Create two network configurations configured as the images below:
https://www.dropbox.com/s/ms0pac4wc2...21.58.png?dl=0
https://www.dropbox.com/s/79ksqy51sj...23.49.png?dl=0
VirtualBox network configuration
- First you need to create a new host-only network on VirtualBox, so open VirtualBox and press the shortcut Command + comma (Settings), then go to Network > Host-only network and click the icon "New" on the right panel. https://www.dropbox.com/s/14wj6fpyp8...56.52.png?dl=0
- After creating vboxnet0, edit it with the following configuration:
https://www.dropbox.com/s/hzunha3fv4...33.48.png?dl=0
https://www.dropbox.com/s/zit9u53okv...34.03.png?dl=0
- Adapter
- IPv4 Address: 192.168.56.100
- IPv4 Network Mask: 255.255.255.0
- IPv6 Address: <leave it blank>
- IPv6 Network Mask Length: 0
- DHCP Server
- Enable it.
- Server Address: 192.168.56.100
- Server Mask: 255.255.255.0
- Lower Address Bound: 192.168.56.101
- Upper Address Bound: 192.168.56.254
Windows Network Configuration
After installing and launching Windows, go to "Control Panel" > "Network and Sharing Center" > "Change Adapter Settings" > "Local area connection" > "Edit" > "Internet Protocol Version 4 (IPv4)" and configure it as the image below to configure Windows network to use static IP address.
https://www.dropbox.com/s/7pybkgmb8c...04.06.png?dl=0
MobaSSH
On the Windows VM, download and install MobaSSH (http://mobassh.mobatek.net/download.html)
IntelliJ IDEA Deployment configuration
On IntelliJ, configure the deployment as the images below:
https://www.dropbox.com/s/1d1hw8o4yp...13.34.png?dl=0
https://www.dropbox.com/s/4w2o3uuuis...17.08.png?dl=0
Check the option "automatic upload"
https://www.dropbox.com/s/lvpe4y5o0v...18.20.png?dl=0
On deployment options, check the option "Upload external changes" and remove ".git" and ".svn" from the excluded items by name.
https://www.dropbox.com/s/2daom83x2h...19.43.png?dl=0
Setting up IntelliJ IDEA custom external tool to compile the pawn script
Create a new External Tool with the following configuration
https://www.dropbox.com/s/letyfefide...22.36.png?dl=0
Change "Program" and "Working directory" paths. You'll also need to create a file called pawncompiler.sh on "Program" directory with the following content:
Code:
#!/bin/sh regex="\/([a-zA-Z]+)$" [[ $1 =~ $regex ]] dirpath=${BASH_REMATCH[1]} echo "$dirpath $1 $2 $3" ssh-add ~/.ssh/id_winvm ssh yourrootusername@127.168.0.27 "cd /drives/c/BRZ/$dirpath/pawno; ./pawncc.exe -i ../$2/$3; exit"
https://www.dropbox.com/s/x83hbizj9u...28.27.png?dl=0
In this example I created the shortcut Command + \, but you can also configure IntelliJ to call the Pawn Compiler tool when you save the file (Command + S).
And finally, the result: (click on the ******* link to view it better)

https://www.youtube.com/watch?v=_4CEfHDYU9M
Pros
- For me, it's way better work with pawn in OSX this way, I don't even need to switch to Windows, I just need to turn it's VM on to call the pawn compiler, I hate switch to windows only to work with pawn scripts.
- You can use all the power of IntelliJ. I know, i know.. there are a lot of other IDE's you would prefer, but for me no one beats IntelliJ for web and pawn development, you don't need to install a hundred of plugins on it, just set pawn as C/C++ script and voilа, you have highlight and autocomplete, it's very customizable, just as Sublime is.
- Tutorial difficult to follow for people who are not use to the tools used in this tutorial.
- A lot of configurations both in Windows and OSX. Execute a bash to call pawn compiler through ssh on Windows, sharing Volumes between Windows and OSX, having the same code on OSX and Windows... I know it's ugly, very ugly.. but what are the other ways to pawn script on OSX?
The tutorial can be incomplete, maybe I miss one step or another.. let me know if you follow this tutorial and couldn't start scripting on OSX!