Skip to content

Commit

Permalink
Add ragepawn.inc
Browse files Browse the repository at this point in the history
  • Loading branch information
GTANAdam committed Apr 14, 2019
1 parent e3de0b5 commit 2829be1
Show file tree
Hide file tree
Showing 20 changed files with 834 additions and 56 deletions.
5 changes: 4 additions & 1 deletion RagePawn/RagePawn.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;RAGEPAWN_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
Expand Down Expand Up @@ -180,6 +180,9 @@
<Project>{493f24e8-e48e-4250-8593-b12ee316aa78}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="ragepawn.inc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
118 changes: 63 additions & 55 deletions RagePawn/RagePawn.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,56 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="API">
<UniqueIdentifier>{05f56e66-e0f6-4811-8de2-e606f9a2f619}</UniqueIdentifier>
</Filter>
<Filter Include="Dependencies">
<UniqueIdentifier>{c507d60a-e1b3-4427-89af-e053c797ac4e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pawn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="format.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="player_natives.cpp">
<Filter>API</Filter>
</ClCompile>
<ClCompile Include="util_natives.cpp">
<Filter>API</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pawn.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="format.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="main.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="callbacks.hpp">
<Filter>API</Filter>
</ClInclude>
<ClInclude Include="api.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="xxHash_xxhash.hpp">
<Filter>Dependencies</Filter>
</ClInclude>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="API">
<UniqueIdentifier>{05f56e66-e0f6-4811-8de2-e606f9a2f619}</UniqueIdentifier>
</Filter>
<Filter Include="Dependencies">
<UniqueIdentifier>{c507d60a-e1b3-4427-89af-e053c797ac4e}</UniqueIdentifier>
</Filter>
<Filter Include="includes">
<UniqueIdentifier>{f81083d1-f7fe-4eba-aba4-4f8f2d8fe69f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pawn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="format.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="player_natives.cpp">
<Filter>API</Filter>
</ClCompile>
<ClCompile Include="util_natives.cpp">
<Filter>API</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pawn.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="format.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="main.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="callbacks.hpp">
<Filter>API</Filter>
</ClInclude>
<ClInclude Include="api.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="xxHash_xxhash.hpp">
<Filter>Dependencies</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ragepawn.inc">
<Filter>API</Filter>
</None>
</ItemGroup>
</Project>
45 changes: 45 additions & 0 deletions RagePawn/ragepawn.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
RAGEPAWN
Contains all of the natives and required stuff to get running
*/
#pragma tabsize 4
#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <datagram>
#define function%0(%1) forward%0(%1); public%0(%1)
// Console
native println(const string[], foreground = -1, background = -1, highlight = -1);
native printfln(const format[], { Float,Fixed,_ }:...);
// String manipulation
native format(output[], const format[], ...);
// Utils
native GetHashKey(const string[]);
native TriggerClientEvent(playerid, const name[], const format[], ...);
native GetPlayerName(playerid, name[]);
// Callbacks
forward OnIncomingConnection(playerid, ip_address[], serial[])
forward OnPlayerConnect(playerid);
forward OnUpdate();
forward OnPlayerDisconnect(playerid, reason, message[]);
forward OnPlayerSpawn(playerid);
forward OnPlayerDeath(playerid, killerid, reason);
forward OnVehicleDeath(vehicleid, killerid);
forward OnVehicleDeathEx(vehicleid, killerid, reason);
forward OnPlayerText(playerid, text[]);
forward OnPlayerCommandText(playerid, cmdtext[]);
forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
forward OnPlayerEnterVehicleEx(playerid, vehicleid, seatId);
forward OnPlayerExitVehicle(playerid, vehicleid);
forward OnPlayerDamage(playerid, Float:healthLoss, Float:armorLoss)
forward OnPlayerStartEnterVehicle(playerid, vehicleid, seatid);
forward OnPlayerStartExitVehicle(playerid,vehicleid);
74 changes: 74 additions & 0 deletions includes/AMXDLL.INC
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* An assortment of additional functions in the DLL version of the
* Abstract Machine.
*
* (c) Copyright 2000-2011, ITB CompuPhase
* This file is provided as is (no warranties).
*/
enum
{
Ok,
Okcancel,
okCancel,
Yesno,
yesNo,
Yesnocancel,
yesNocancel,
yesnoCancel,
}
enum
{
noicon,
information,
exclamation,
question,
stop
}
native messagebox(const message[], const caption[], buttons=Ok, icons=noicon, timeout=0);
/* Types:
* i = integer (16/32 bit)
* l = 32-bit integer
* h = handle (16/32 bit)
* p = packed string
* s = (unpacked) string
* w = 16-bit unsigned integer
* lower case = by value, upper case = by reference
*
* The types noted as "16/32 bit" are converted to 16-bit in Win16 environments
* prior to the call to the DLL.
*
* calldll() attaches "32" to the dll name if it cannot load the DLL as you
* provide it. So it loads "user32" if you specify "user" and you are in Win32.
* calldll() also appends a "A" to the function name if it cannot find the
* function as specified. So it call "GetWindowTextA" if you ask for
* "GetWindowText". By this means, the interface is more compatible between
* 16-bit and 32-bit platforms.
*/
native calldll(const dllname[], const function[], const typestr[]="", ...);
native loaddll(const dllname[]);
native freedll(const dllname[]);
native iswin32();
native balloon(&Balloon:handle, text[]="", x=0, y=0, timeout=-1);
native balloonfont(&Balloon:handle, const font[]="", height=16, weight=400, italic=0);
stock wGetCursorPos(&x, &y)
/* Get the current position of the mouse cursor relative to the upper
* left corner of the screen
*/
{
new point[2]
calldll(!"user","GetCursorPos","I",point)
if (!iswin32())
{
point[1] = point[0] >> 16
point[0] &= 0xffff
}
x = point[0]
y = point[1]
}
86 changes: 86 additions & 0 deletions includes/EPLAY.INC
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/* EGI player functions
*
* You need the EGI DLLs and the DLL version of the Small AMX to use these
* routines.
*
* (c) Copyright 1998-2007, ITB CompuPhase
* This file is provided as is (no warranties).
*/

enum FlicParam
{
FLIC_PARAM_ISPLAYING, /* 1=FLIC file is currently playing */
FLIC_PARAM_WIDTH, /* size of the frame */
FLIC_PARAM_HEIGHT,
FLIC_PARAM_NUMFRAMES, /* total number of frames */
FLIC_PARAM_CURFRAME, /* current frame number */
FLIC_PARAM_CONTINUOUS, /* segment is continuous (it has a ring frame) */
FLIC_PARAM_SPEED, /* playback speed, set to 0 for max. speed */
FLIC_PARAM_DESIGNSPEED,/* design speed, read from FLIC file */
FLIC_PARAM_REALSPEED, /* real playback speed */
FLIC_PARAM_MODE, /* BitBlt mode */
FLIC_PARAM_LOOP, /* loop frames or only play once */
FLIC_PARAM_NUMSEGMENTS,
FLIC_PARAM_CURSEGMENT,
FLIC_PARAM_XPOS, /* position of the animation in the window */
FLIC_PARAM_YPOS,
FLIC_PARAM_LABEL, /* label of the current frame (-1 if none) */
FLIC_PARAM_CHGPAL, /* use current palette, don't create a new one */
FLIC_PARAM_VERSION, /* current version of EGI player */
FLIC_PARAM_SEGLABEL, /* the label of the current segment */
FLIC_PARAM_DRAWFRAME, /* draw the frames? */
FLIC_PARAM_FRNOTIFY, /* notify for each frame? */
FLIC_PARAM_MASK, /* masks present (0=no, 1=bitmap, 2=multilevel) */
FLIC_PARAM_ID, /* user specified id */
FLIC_PARAM_MSGNUM, /* value of FLIC_NOTIFY */
FLIC_PARAM_KEYFREQ, /* key frame interval (0 if there are no key frames) */
FLIC_PARAM_SKIPDELTAS, /* skip all delta frames up to the next key frame */
FLIC_PARAM_PALMODE, /* palette mode */
FLIC_PARAM_IDENTPAL, /* 1:1 mapping DIB colour table to logical palette? */
FLIC_PARAM_SENDNOTIFY, /* send notification messages? */
FLIC_PARAM_COLORDEPTH, /* 8=256 colours, 15, 16 or 24 = RGB */
FLIC_PARAM_NUMREGRECTS,/* number or recangles that form the region */
FLIC_PARAM_LASTFRAME, /* last frame to play */
FLIC_PARAM_PLAYWAVE, /* play audio chunks y/n */
FLIC_PARAM_SYNCHRONIZE,/* speed is more important than quality */
FLIC_PARAM_NEXTSEGMENT,/* segment that (by design) follows this one */
FLIC_PARAM_REPEATS, /* number of repeats for the segment */
FLIC_PARAM_DESIGNWIDTH,/* design size, read from FLIC file */
FLIC_PARAM_DESIGNHEIGHT,
FLIC_PARAM_PRELOAD, /* preload the next frame? */
FLIC_PARAM_FRAMEBITS, /* data chunks in last frame */
FLIC_PARAM_XORG, /* position of the origin in the frame's rectangle */
FLIC_PARAM_YORG,
FLIC_PARAM_TOTALFRAMES,/* total number of frames (over all segments) */
FLIC_PARAM_SCALEOPTION,/* method of scaling (point-sampling, smooth Bresenham) */
FLIC_PARAM_TRANSPCOLOR,/* transparent colour of the animation file (or -1) */
}
native FlicGetParam(FlicParam:index);
native FlicSetParam(FlicParam:index,param);

enum
{
FLIC_ERR_NONE,
FLIC_ERR_FOPEN,
FLIC_ERR_FORMAT,
FLIC_ERR_FREAD,
FLIC_ERR_MEMORY,
FLIC_ERR_PARAM,
FLIC_ERR_INVALID,
FLIC_ERR_MUTEX,
FLIC_ERR_UNSUPPORT,
FLIC_ERR_LOCKED,
FLIC_ERR_WAVEOPEN,
FLIC_ERR_FLICHANDLE,
FLIC_ERR_GENERIC,
}
native FlicError:FlicError();

native FlicPlay(hwnd=0);
native FlicStop();
native FlicClose();

native FlicVersion();
native FlicHandle(); /* returns the "LPFLIC" handle for this AMX */

native FlicMoveWindow(x=0, y=0, bool:delta=false);
9 changes: 9 additions & 0 deletions includes/RND.INC
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
AMX Random functions for small.
by Dark Fiber <[email protected]>
*/

native set_rnd_seed(newseed);
native reset_rnd_seed();
native get_rnd_seed();
native rnd(maxrnd=0);
11 changes: 11 additions & 0 deletions includes/args.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Script Arguments support functions
*
* (c) Copyright 2005-2011, ITB CompuPhase
* This file is provided as is (no warranties).
*/
#pragma library Args

native argcount();
native bool: argindex(index, value[], maxlength = sizeof value, bool: pack = true);
native bool: argstr(index = 0, const option[] = ``'', value[] = ``'', maxlength = sizeof value, bool: pack = true);
native bool: argvalue(index = 0, const option[] = ``'', &value = cellmin);
19 changes: 19 additions & 0 deletions includes/bstring.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Minimalistic wrapper for the "Better String library" by Paul Hsieh
*
* (c) Copyright 2004-2011, ITB CompuPhase
* This file is provided as is (no warranties).
*/
#pragma library BString
/* native functions */
native String: bstring(const source[] = ``'');
native String: bstrdup(String: source);
native String: bstrcat(String: target, String: source);
native bstrlen(String: source);
native String: bstrmid(String: source, start = 0, length = cellmax);
native bstrtoarray(target[], size = sizeof target, String: source,
bool: packed = true);
/* user-defined operators */
native String:operator=(String:oper) = bstrdup;
native String:operator+(String:oper1, String:oper2) = bstrcat;
Loading

0 comments on commit 2829be1

Please sign in to comment.