Hello, thanks for this project. Hopefully we can make it even better.
I have written a PHP script to take the sourcepawn from TOGs "newsyntax.sp" and process into new methodmaps. For example (pseudo test code, not real world):
Spoiler
PHP Code:
SetEventInt(hEvent, "userid", GetAdminFlag(client));
int blah = GetConvarInt(hTest);
// TO
hEvent.SetInt("userid", client.HasFlag());
int blah = hTest.IntValue;
AddMenuItem(menu, "", "X + 5.0");
AddMenuItem(menu, "", "Y + 5.0");
AddMenuItem(menu, "", "Z + 5.0");
SetMenuTitle(menu, "Set Angle");
SetMenuExitButton(menu, false);
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
// TO
menu.AddItem("", "X + 5.0");
menu.AddItem("", "Y + 5.0");
menu.AddItem("", "Z + 5.0");
menu.SetTitle("Set Angle");
menu.ExitButton = false;
menu.ExitButton = true;
menu.Display(client, MENU_TIME_FOREVER);
Handle hCfg = OpenFile(sPath, "w");
WriteFileLine(hCfg, "");
if(hCfg!=INVALID_HANDLE) CloseHandle(hCfg); // Test
// TO
File hCfg = OpenFile(sPath, "w");
hCfg.WriteLine("");
if(hCfg!=INVALID_HANDLE) delete hCfg; // Test
// Load config
Handle hFile = CreateKeyValues("flares");
if( !FileToKeyValues(hFile, sPath) )
// TO
KeyValues hFile = new KeyValues("flares");
if( !hFile.ImportFromFile(sPath) )
public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
public int AngMenuHandler(Handle menu, MenuAction action, int client, int index)
// TO
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
public int AngMenuHandler(Menu menu, MenuAction action, int client, int index)
BfWriteByte(UserMsgShake, 0);
BfWriteFloat(UserMsgShake, 1.0);
BfWriteFloat(UserMsgShake, 0.5);
BfWriteFloat(UserMsgShake, 0.5);
// TO
UserMsgShake.WriteByte(0);
UserMsgShake.WriteFloat(1.0);
UserMsgShake.WriteFloat(0.5);
UserMsgShake.WriteFloat(0.5);
Can anyone with knowledge of the new methodmaps and ideally PHP also, help me finish anything I've missed? There are probably still some issues to work. I've converted all my scripts (69 plugins/73k lines/2.2m chars) with TOGs VBA project and my script to use the new syntax and methodmaps, which took maybe about 5 hours due to compiler warnings from VBA not handling the data types correctly and some time refining the PHP script.
I'll post the PHP script in future when it's cleaned up.
__________________