[Plugin] pawnCompiler - Compile your scripts without pawno
#1

Hello, this is my first plugin release. This plugin makes sure that you can compile a script without opening pawno to compile. It's just with a simple function.

Here are the functions with additional info:
pawn Код:
/*
    @Release: pawnCompiler
    @Author: RyDeR`
    @Version: 1.0
    @Last Update: 04/08/2010 - 14:30
    @Bugs: -
    @Functions:
            @Functon: WinExec(path[])
            @Info: Use to execute programs. (like .exe, .bat, etc..)
            @params:
                - path[] = The path of the program.


            @Function: returnServerPath(strdest[])
            @Info: Stores your server path to a string.
            @params:
                - strdest[] = The string where you're going to store your data in.


            @Function: existFile(path[])
            @Info: Checks if a file exists (in your server folder).
            @params:
                - path[] = The path you want to check if exists.

            @Function: compileScript(directory[], scriptName[])
            @Info: Compiles your scripts.
            @params:
                - directory[] = In which directory your script is. (e.g. filterscripts, gamemodes, scriptfiles..)
                - scriptName[] = The name of the script you want it to compile. (e.g. vehiclespawner (without .pwn extention))

    @Author Notes: -
*/
The main function is compileScript which will compile your script. The rest are all needed to get this job done. But you can also use them seperate.

Here's an example script:
pawn Код:
#include <a_samp>
#include <pawnCompiler>

#if !defined strtokVar
#define strtokVar(%0,%1,%2) \
    SetPVarString(%0, %1, strtok(cmdtext, idx)), GetPVarString(%0, %1, %2, sizeof(%2)), DeletePVar(%0, %1)
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    new
        idx,
        cmd[128]
    ;
    cmd = strtok(cmdtext, idx);

    if(!strcmp(cmd, "/compile", true))
    {
        new
            directory[32],
            scriptName[20]
        ;
        strtokVar(playerid, "directory", directory);
        strtokVar(playerid, "scriptName", scriptName);
        if(!strlen(directory) || !strlen(scriptName)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /compile [directory] [scriptname]");
        return SendClientMessage(playerid, 0xFFFFFFFF, compileScript(directory, scriptName));
    }
    return 0;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
With this script you can compile your script when you're ingame with command /compile [directory] [scriptname].

Click here to download - Plugin + Include + Source

Changelog:
- 04/09/2010:
First public release.

- 05/09/2010:
Deleted creating .xml.

EDIT: Please always re-compile if you download an updated version of this script.
Reply


Messages In This Thread
pawnCompiler v1.0 - Compile your scripts without pawno - by RyDeR` - 04.09.2010, 13:02
Re: pawnCompiler - Compile your scripts without pawno - by WillyP - 04.09.2010, 13:07
Re: pawnCompiler - Compile your scripts without pawno - by Defrinex - 04.09.2010, 13:09
Re: pawnCompiler - Compile your scripts without pawno - by kamalhood - 04.09.2010, 13:10
Re: pawnCompiler - Compile your scripts without pawno - by Hiddos - 04.09.2010, 13:19
Re: pawnCompiler - Compile your scripts without pawno - by RyDeR` - 04.09.2010, 13:36
Re: pawnCompiler - Compile your scripts without pawno - by iZN - 04.09.2010, 13:38
Re: pawnCompiler - Compile your scripts without pawno - by Victor - 04.09.2010, 13:46
Re: pawnCompiler - Compile your scripts without pawno - by pliva_sb - 04.09.2010, 16:52
Re: pawnCompiler - Compile your scripts without pawno - by Calgon - 04.09.2010, 17:00
Re: pawnCompiler - Compile your scripts without pawno - by Toni - 04.09.2010, 22:30
Re: pawnCompiler - Compile your scripts without pawno - by lolumadd - 05.09.2010, 05:03
Re: pawnCompiler - Compile your scripts without pawno - by DiddyBop - 05.09.2010, 05:12
Re: pawnCompiler - Compile your scripts without pawno - by RyDeR` - 05.09.2010, 10:18
Re: pawnCompiler - Compile your scripts without pawno - by RoBo - 05.09.2010, 10:46
Re: pawnCompiler - Compile your scripts without pawno - by Jochemd - 05.09.2010, 11:13
Re: pawnCompiler - Compile your scripts without pawno - by James124 - 05.09.2010, 11:26
Re: pawnCompiler - Compile your scripts without pawno - by lolumadd - 05.09.2010, 14:21
Re: pawnCompiler - Compile your scripts without pawno - by RyDeR` - 05.09.2010, 14:28
Re: pawnCompiler - Compile your scripts without pawno - by HyperZ - 06.09.2010, 17:53
Re: pawnCompiler - Compile your scripts without pawno - by gamer931215 - 06.09.2010, 17:56
Re: pawnCompiler - Compile your scripts without pawno - by RyDeR` - 06.09.2010, 18:06
Re : pawnCompiler - Compile your scripts without pawno - by Ruto - 01.05.2011, 20:40
Re: Re : pawnCompiler - Compile your scripts without pawno - by blackwave - 01.05.2011, 21:06
Re: Re : pawnCompiler - Compile your scripts without pawno - by Donya - 01.05.2011, 22:06
Re: Re : pawnCompiler - Compile your scripts without pawno - by Cameltoe - 01.05.2011, 22:50
Re: pawnCompiler - Compile your scripts without pawno - by Rob_Zero - 03.06.2011, 08:05
Re : pawnCompiler - Compile your scripts without pawno - by Varkoll_ - 06.06.2011, 17:02
Re: pawnCompiler - Compile your scripts without pawno - by iMonk3y - 05.08.2011, 19:27
Re: pawnCompiler - Compile your scripts without pawno - by Gareth - 08.09.2011, 09:02
Respuesta: pawnCompiler - Compile your scripts without pawno - by Dreyfuz - 03.08.2015, 02:10
Re: Respuesta: pawnCompiler - Compile your scripts without pawno - by Crayder - 03.08.2015, 11:53
Re: pawnCompiler - Compile your scripts without pawno - by Abagail - 03.08.2015, 18:40
Respuesta: pawnCompiler - Compile your scripts without pawno - by MatrixenXD - 03.08.2015, 19:08

Forum Jump:


Users browsing this thread: 1 Guest(s)