SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 04/09/2010, 03:20 PM   #1
Slice
High-roller
 
Join Date: Mar 2008
Posts: 1,831
Reputation: 1607
Lightbulb PAWN for SA-MP in Notepad++

Hey,
I made my own Notepad++ language/API for SA-MP scripting, follow these steps and you can have it too!
Here's an example on what it looks like:


Screenshot!

For those who aren't familiar with Notepad++, you can read about it & download here: http://notepad-plus-plus.org/

If you want Notepad++ to show every single word in the current document, you can select "Word completion". That might get annoying with large scripts, however.

To get the syntax highlight working, you will need to download my custom userDefineLang.xml then place it in your Notepad++ AppData folder (see below).

Now, type in %appdata%\Notepad++ in your Explorer (or in Run).

You should see a folder with a couple files (config.xml, contextMenu.xml, shortcuts.xml, stylers.xml).

NOTE: If you have a file called userDefineLang.xml that you want to keep, you will have to merge those files manually.

Copy the downloaded userDefineLang.xml to the folder you're in (it should look something like this).

After that, you need to associate Notepad++ with PAWN files, see below.

Additionally, you can put .inc there if you want to.

Auto-complete
You will need an API file for the auto-completion.

Download PAWN.xml (right click -> save link/target) and put it in the "APIs" folder; this, however, is not located in your AppData. It's in the program's main folder.


It should look somewhat like this:


Ctrl + Space will pop up the auto-complete, and Ctrl + Shift + Space will show the function arguments.
You can, however, make this happen automatically by changing your settings, see below:

Click that and find this tab:

If you want to see the auto-complete instantly, put "From the 1 th character".

Compiling
For this to work, you will need a plugin called NppExec. If you already have it, skip this step.

If you don't have the Plugin Manager, download the latest copy of Notepad++.

Check NppExec and click Install; restart Notepad++ when prompted to.


Put this code in the window that pops up:

Put npp_save on the first line if you want to save the file before compiling automatically (lazy motherfucker..).
Code:
cd $(CURRENT_DIRECTORY)
"C:\Program Files (x86)\PAWN Compiler\pawncc.exe" "$(FILE_NAME)" -; -(
NOTE: Replace the path to match your PAWN compiler folder; also make sure you have an "include" folder in there with the latest SA-MP include files.



Now it should try compiling whatever document you have open. If you see any output from the PAWN compiler, then it's looking good so far.


Optionally, check this to slim down the output in the command window.


Now you will probably want to assign a hotkey to the compile script.

Open up the NppExec settings.


Select "PAWN Compiler" from the list, click "Add/Modify", then click "OK".


Restart Notepad++.

Open up the shortcut mapper.


Find "PAWN Compiler" under "Plugin commands"; double click it.



Select a suitable key (combination) then click "OK" and click "Close" on the shortcut mapper.

Last edited by Slice; 27/03/2011 at 08:40 PM.
Slice is offline   Reply With Quote
Old 04/09/2010, 03:25 PM   #2
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: England
Posts: 2,027
Reputation: 63
Default Re: PAWN for SA-MP in Notepad++

love the auto complete!
__________________
once average now terrible
WillyP is offline   Reply With Quote
Old 04/09/2010, 04:38 PM   #3
Hiddos
High-roller
 
Hiddos's Avatar
 
Join Date: Sep 2008
Posts: 3,304
Reputation: 2184
Default Re: PAWN for SA-MP in Notepad++

Lemme try this, notepad is one of the good things that microsoft created.
__________________
Quote:
Originally Posted by DeWolf View Post
For fuck's sake people, this whole thread is fucked up now.
Hiddos is offline   Reply With Quote
Old 04/09/2010, 04:44 PM   #4
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: PAWN for SA-MP in Notepad++

Quote:
Originally Posted by Hiddos View Post
Lemme try this, notepad is one of the good things that microsoft created.
This is for Notepad++, not Microsoft Notepad...
Calgon is offline   Reply With Quote
Old 04/09/2010, 04:46 PM   #5
Hiddos
High-roller
 
Hiddos's Avatar
 
Join Date: Sep 2008
Posts: 3,304
Reputation: 2184
Default Re: PAWN for SA-MP in Notepad++

Quote:
Originally Posted by Calgon View Post
This is for Notepad++, not Microsoft Notepad...
Damn I failed. Well they got kinda the base idea from it (/me runs)
__________________
Quote:
Originally Posted by DeWolf View Post
For fuck's sake people, this whole thread is fucked up now.
Hiddos is offline   Reply With Quote
Old 13/02/2011, 10:20 AM   #6
Mean
High-roller
 
Join Date: Jul 2010
Location: 14th annual lemon party
Posts: 2,727
Reputation: 229
Default Re: PAWN for SA-MP in Notepad++

Quote:
Originally Posted by Calgon View Post
This is for Notepad++, not Microsoft Notepad...
You just gotta lol at this. LoL.
EDIT: I didn't read the comment above ^^
Mean is offline   Reply With Quote
Old 18/02/2011, 07:18 PM   #7
!Phoenix!
Big Clucker
 
Join Date: Feb 2011
Location: 127.0.0.1 - Germany
Posts: 81
Reputation: 0
Default Re: PAWN for SA-MP in Notepad++ - Doesn't work for me

Hey,

I hope you can help me:
- I added both files and activated the Auto-Completion (4 Characters)
1. There is no syntax highlighting ("PAWN" doesn't appear in the Languages-list as well)
2. The Auto-Complete doesn't work properly; the list with the available functions only pops up when I press Strl + Enter and the list with the arguments never appears.

(Windows XP)

Do you have any idea?


--------------------------------------
Edit:
I tried to use it with notepad++ portable - and it works.
I know I could use it like this or I could try to re-install notepad++, but I would be happier if anyone would have an idea to solve the problem
(-> My program has an error - Re: Oh you have to reinstall your windows!)

--------------------------------------
Edit 2:
De-installed notepad++ - cleaned the registry - installed notepad++ again - nothing changed
With the portable version it's still working

Last edited by !Phoenix!; 18/02/2011 at 08:16 PM.
!Phoenix! is offline   Reply With Quote
Old 04/09/2010, 06:02 PM   #8
woot
Gangsta
 
Join Date: Jun 2007
Posts: 785
Reputation: 173
Default Re: PAWN for SA-MP in Notepad++

Nice, thank you!

Last edited by woot; 04/09/2010 at 06:22 PM.
woot is offline   Reply With Quote
Old 04/09/2010, 06:06 PM   #9
General Abe
Big Clucker
 
General Abe's Avatar
 
Join Date: Jan 2008
Posts: 77
Reputation: 12
Default Re: PAWN for SA-MP in Notepad++

This is epic. Using it right now... being able to keep track of loose brackets/what ones you're working within has to be the best thing since sliced bread.
__________________
Co-developer of Vortex Roleplay, three-time director of development & two-year assistant director of development at NGG.
General Abe is offline   Reply With Quote
Old 04/09/2010, 10:21 PM   #10
joemomma53
Huge Clucker
 
Join Date: Jul 2007
Posts: 463
Reputation: 1
Default Re: PAWN for SA-MP in Notepad++

This is great, nice job
joemomma53 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PAWN plugin for Notepad++ ettans Help Archive 5 18/05/2011 05:23 PM
Tutorial: Script with Notepad++ ! yom Help Archive 12 27/01/2011 09:41 AM
How to make something in pawno respond with a notepad? anonymoushacker Help Archive 3 31/07/2009 11:31 PM
Notepad++ plugin help johnmeikle33 Help Archive 3 11/03/2009 09:04 PM


All times are GMT. The time now is 09:27 AM.


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