View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-25-2020 , 17:58   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #58

Quote:
Originally Posted by Dragokas View Post
Maybe, it will make life easier for somebody.

===========================================
Batch sm plugins converter to new syntax.
===========================================

Benefits: all-in-one. Simple right click => got new .sp/.smx

Copyrights:

MethodMaps converter by Peace-Maker.
New-syntax converter by ThatOneGuy (port to VB6 by SilverShot and Dragokas).
Batch Script by Dragokas.

------------------------------------------

Installation:

- Install Python: https://www.python.org/downloads/
- Download and unpack SourcePawn compiler for Windows (v.1.8+): https://www.sourcemod.net/downloads.php?branch=dev
- Unpack this archive.
- Edit sp_file_handler.reg to point to your compiler path.
- Apply sp_file_handler.reg by double-click.
- Edit Convert_Syntax.cmd to point "include" in correct folder path of your compiler.
- Make shortcut to file "Convert_Syntax.cmd"
- Press Win + R, enter "Shell:Sendto" and place shortcut in opened window.

Usage:

- Press right mouse click on your old-syntax .sp file => choose "Convert_Syntax".
- Wait for coverting to new syntax (stage 1).
- spcomp.exe will try to compile. If errors appear, you should manually fix them (file "plugin.sp").
- Press any key (enter).
- Wait for coverting to new methodmaps (stage 2).
- spcomp.exe will try to compile. If errors appear, you should manually fix them (file "plugin_mm.sp"):
> Usually it's wrong var. types like:
>> Handle cvar = INVALID_HANDLE; => should be: ConVar cvar;
>> Handle hMenu => should be: Menu hMenu
>> Handle hEvent => should be: Event hEvent e.t.c.

At the end, you will receive:
- plugin.sp.bak (your original file). It will not be overwritten in any situation.
- plugin.sp (after stage 1 - new syntax only)
- plugin_mm.sp (after stage 2 - new syntax + new methodmaps)
- .smx files for each stage.
native SQLiteVIPAPI_AddFeature(char FeatureName[64], Handle VIPLevelList, Handle NameList, &bool AlreadyExisted=false);

This is generated by your converter, should be bool &. Also should be native int SQLiteVIPAPI_Add...
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 01-25-2020 at 18:00.
eyal282 is offline