[Tool/Web/Other] #define a 10 | public cmd_a+1 | public cmd_a+2 | - NOW POSSIBLE! - [beta] - Gamer_Z's PawnPreProcessor | v0.1
#1

NOTE: All repositories moved from googlecode to Github: http://gpb.gz0.nl/
Yes it's possible now thanks to my program (which is in beta , any code contributions are welcome!).

First of all, you all know I'm just a hobby programmer, NO PRO! So don't flame me for bad code, but explain why it is bad code and suggest/contribute something! Else don't comment the source. Ok? Let's go on..


Look at this:
pawn Code:
#include <a_samp>
#define zcmd:%0(%1,%2) forward zcmd_%0(%1,%2);public zcmd_%0(%1,%2)
#adder TEST_x   (   100 )
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

forward cmd_TEST_x    +     1(param);//note the spaces etc
public cmd_TEST_x    +      1(param)
{
    return 1;
}
forward cmd_TEST_x(param);
public cmd_TEST_x(param)
{
    return 1;
}

forward cmd_TEST_x+ 65456(param);
public cmd_TEST_x    +      65456(param)
{
    return 1;
}
zcmd:TEST_x+50(playerid,cmdtext[])
{
    return 1;
}
you see the #adder directive, that is a special directive dedicated for this program.
The program is very simple so do not use any weird syntaxt or comments between definitions (from now on 'adders')!
Keep it simple and clean so you won't crash the program.

after my preprocessor is done the code will look like:
pawn Code:
#include <a_samp>
#define zcmd:%0(%1,%2) forward zcmd_%0(%1,%2);public zcmd_%0(%1,%2)

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    printh(" Blanhk Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

forward cmd_101(param);
public cmd_101(param)
{
    return 1;
}
forward cmd_100(param);
public cmd_100(param)
{
    return 1;
}

forward cmd_65556(param);
public cmd_65556(param)
{
    return 1;
}
zcmd:50556(playerid,cmdtext[])
{
    return 1;
}
you can see it's still a little buggy, but we will fix it together.. the code compiles fine .
The best part is, now you can enjoy the speed of FDLG and named dialogs together!

Note 1: I am not responsible in ANY way for damage caused by this preprocessor program.
Note 2: You need Microsoft C++ Redistributable 2010 32 bit edition and .NET Framework 2.0

Installation:
The Gamer_Z's PawnPreProcessor package is part of the GPB project, you can obtain it from: http://code.google.com/p/gpb/downloads/list ( http://gpb.googlecode.com )

Download the package, after unzipping it to anywhere you have two folders:
Pawno and Source.
the source is obivious - the program's code.
The pawno folder contains the files you need to copy to your original pawno folder you are using.
If you have an modified (apart from the sa-mp.com's version) version of pawncc.exe change the name to pawncco.exe and then only copy over the pawncc.exe from the package pawno folder to your own pawno folder, else you can just copy all files.

Waiting for feedback from ya all, have fun
and remember, contribute code, help improving if you can!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)