[In Development]Programming Windows with PAWN!
#1

Discontinued.

Introduction

Hi Readers

I'm currently working on a C project, that will work with PAWN scripts (4.0 compiler):
It work similar to Java(The .jar file runs in Java Abstract Machine), because this program is using the PAWN Abstract Machine, like SA-MP, and I'm implementing a lot of functions from the start.
I decided to make this program for PAWN scripters that don't know any other language.

I'm using some of the default libraries files made by CompuPhase, but I edited the names of the functions (Now they're more stylish XD):

String.inc - This library provides functions for string handling
Core.inc - This one has the basic core functions
Float.inc - This one has functions for managing floating point values
Fixed.inc - This one is not included in SA-MP, It's util for fixed point values

And finally my own include file!! It has the basic functions for managing an entire program.

Windows.inc - Made entirely by me, Sasino97

And now a little example to show you just 1/5 of what you can do now with this. (The example has changed a bit before the last example)

Example
(New syntax)

pawn Code:
/**
        InputTest - By [GF]Sasino97.
        This example will get keyboard and mouse input from the user and send it back as a messagebox.
       
        This file is provided as is (no warranties).
*/


#include <ppp> // PAWN++ - Read below
#include <windows> // Windows
#include <string> // It's the same of SA-MP, but the names are edited :D

// Notice that the "Int:", "Point:", "Color:" and "Char:" Tags ARE OPTIONAL.

Int: @WinMain() /*   The int tag is optional, same as "@WinMain()"  */
{
    SetWindowText("This is an input test!");
    MaximizeWindow();
    return 0;
}

Int: @WinExit() { Quit(); }

Int: @OnClick(Int: button, Point: x, Point: y) // "button" is the mouse button (Left, right, middle), not a button control, see windows.inc
{
    CHAR s{256}; // Same of "new s{256};", it will give no errors
    String.Format(s, 256, true, "Button: %d\nX: %d\nY: %d", button, x, y); // Same of "format" (But only in SA-MP, here it'll give errors unless you define it)
    MessageBox(s, "OnClick", ICON_WARNING, DIALOG_OK);
    return 0;
}

Int: @OnKeyPress(Int: key) // When a key is pressed
{
    CHAR s{256};
    String.Format(s, 256, true, "Key: %d", key);
    MessageBox(s, "OnKeyPress", ICON_WARNING, DIALOG_OK);
    return 0;
}
Windows PAWN 1.0 RC - Release

Notice: The examples are compiled in amx format, but with the extension ".pwnexe".
A lot of people requested it, so I will release it now (With the source code

http://www.2shared.com/file/6KUj2-BT/WinPawn.html

Set-up

This doens't have an auto-extract installer, so you have to set it up manually:

1 - Create a folder called "WinPawn" into your "Program Files" or "Program Files (x86)" directory.
2 - Put "WinPawn.exe" and the "compiler" folder into WinPawn
3 - Open your PAWN Code Editor (I suggest to use Notepad++ instead of pawno, because you can link multiple compilers), and give the right directory to the compiler, or if using pawno, put pawno in the directory of WinPawn.
4 - Include "ppp" and "windows", make your program, compile. If you are using Notepad++, please compile to ".pwnexe".
5 - Right click on the .amx/.pwnexe file, select "Open with" and browse for my program in the WinPawn directory.
6 - In the description box, write "Executable PAWN File".
7 - Press OK, and see how it works
8 - If something went wrong read again all.
9 - Good work with your programs

PAWN++

Pawn++ is not a big thing, it's just a file with some defines that you will find useful:
I called it with that name because introduces a new way to add variables: The keyword "new" disappears, and
to declare a variable, it will use

pawn Code:
#define CELL   new
    #define CHAR   new Char:
    #define BOOL   new bool:
    #define INT    new Int:
    #define POINT  new Point:
    #define COLOR  new Color:
    #define MENU   new Menu:
    #define EDIT   new Edit:
    #define RADIO  new Radio:
    #define FLOAT  new Float:
    #define FIXED  new Fixed:
Reply


Messages In This Thread
[In Development]Programming Windows with PAWN! - by Sasino97 - 29.09.2011, 14:04
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Kyosaur - 29.09.2011, 14:53
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by suhrab_mujeeb - 29.09.2011, 14:57
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Gamer_Z - 29.09.2011, 15:04
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Lorenc_ - 29.09.2011, 15:13
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Sasino97 - 30.09.2011, 12:59
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Sasino97 - 02.10.2011, 07:49
Re: [In Development]Programming Windows with PAWN! - by Hiddos - 02.10.2011, 09:02
Re: [In Development]Programming Windows with PAWN! - by Sasino97 - 02.10.2011, 09:07
Respuesta: [In Development]Programming Windows with PAWN! - by kirk - 02.10.2011, 11:58
Re: [In Development]Programming Windows with PAWN! - by saiberfun - 02.10.2011, 12:00
Re: [In Development]Programming Windows with PAWN! - by JernejL - 02.10.2011, 12:47
Re: [In Development]Programming Windows with PAWN! - by Schurman - 02.10.2011, 15:29
Re: [In Development]Programming Windows with PAWN! - by KoczkaHUN - 02.10.2011, 17:52
Re: [In Development]Programming Windows with PAWN! - by SkizzoTrick - 02.10.2011, 18:18
Re: [In Development]Programming Windows with PAWN! - by Kush - 02.10.2011, 18:19
Re: [In Development]Programming Windows with PAWN! - by Gamer_Z - 02.10.2011, 21:41
Re: [In Development]Programming Windows with PAWN! - by Y_Less - 02.10.2011, 22:25
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Kyosaur - 02.10.2011, 22:28
Re: [In Development]Programming Windows with PAWN! - by Toni - 02.10.2011, 23:00
Re: [In Development]Programming Windows with PAWN! - by Ricop522 - 03.10.2011, 01:36
Re: [In Development]Programming Windows with PAWN! - by Vai_Besta - 03.10.2011, 02:43
Re: [In Development]Programming Windows with PAWN! - by Paramount. - 03.10.2011, 18:26
Re: [In Development]Programming Windows with PAWN! - by [GF]Sasino97 - 03.10.2011, 19:24
Re: [In Development]Programming Windows with PAWN! - by [GF]Sasino97 - 06.10.2011, 10:28
Re: [In Development]Programming Windows with PAWN! - by Vai_Besta - 10.10.2011, 21:39
Re: [In Development]Programming Windows with PAWN! - by Ricop522 - 11.10.2011, 01:59

Forum Jump:


Users browsing this thread: 1 Guest(s)