Skip to content

Commit fc4b36a

Browse files
committed
Added support for version 0.3.7 R4-2
Добавлена поддержка версии 0.3.7 R4-2.
1 parent 1701d84 commit fc4b36a

34 files changed

Lines changed: 1311 additions & 25 deletions

SA-MP API/init.lua

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,29 @@ local module = {
1616
}
1717

1818
local offset = {
19-
stChatInfo = {['0_3_7-R1'] = 0x21A0E4, ['0_3_7-R3'] = 0x26E8C8, ['0_3_DL-R1'] = 0x2ACA10};
20-
stInputInfo = {['0_3_7-R1'] = 0x21A0E8, ['0_3_7-R3'] = 0x26E8CC, ['0_3_DL-R1'] = 0x2ACA14};
21-
stKillInfo = {['0_3_7-R1'] = 0x21A0EC, ['0_3_7-R3'] = 0x26E8D0, ['0_3_DL-R1'] = 0x2ACA18};
22-
stSAMP = {['0_3_7-R1'] = 0x21A0F8, ['0_3_7-R3'] = 0x26E8DC, ['0_3_DL-R1'] = 0x2ACA24};
23-
stScoreboardInfo = {['0_3_7-R1'] = 0x21A0B4, ['0_3_7-R3'] = 0x26E894, ['0_3_DL-R1'] = 0x2AC9DC};
24-
stDialogInfo = {['0_3_7-R1'] = 0x21A0B8, ['0_3_7-R3'] = 0x26E898, ['0_3_DL-R1'] = 0x2AC9E0};
25-
stGameInfo = {['0_3_7-R1'] = 0x21A10C, ['0_3_7-R3'] = 0x26E8F4, ['0_3_DL-R1'] = 0x2ACA3C};
26-
27-
fnAddChatCmd = {['0_3_7-R1'] = 0x065AD0, ['0_3_7-R3'] = 0x069000, ['0_3_DL-R1'] = 0x0691B0};
28-
fnRequestSpawn = {['0_3_7-R1'] = 0x003EC0, ['0_3_7-R3'] = 0x003A20, ['0_3_DL-R1'] = 0x003F40};
29-
fnSpawn = {['0_3_7-R1'] = 0x003AD0, ['0_3_7-R3'] = 0x003AD0, ['0_3_DL-R1'] = 0x003B20};
30-
fnAddChatMsg = {['0_3_7-R1'] = 0x064010, ['0_3_7-R3'] = 0x067460, ['0_3_DL-R1'] = 0x067650};
31-
fnSetInputMode = {['0_3_7-R1'] = 0x09BD30, ['0_3_7-R3'] = 0x09FFE0, ['0_3_DL-R1'] = 0x0A0530};
32-
fnUnlockActorCam = {['0_3_7-R1'] = 0x09BC10, ['0_3_7-R3'] = 0x09FEC0, ['0_3_DL-R1'] = 0x0A0410};
33-
fnUpdateScoreboard = {['0_3_7-R1'] = 0x008A10, ['0_3_7-R3'] = 0x008BA0, ['0_3_DL-R1'] = 0x008C00};
34-
fnSay = {['0_3_7-R1'] = 0x0057F0, ['0_3_7-R3'] = 0x005820, ['0_3_DL-R1'] = 0x005860};
35-
fnSendCmd = {['0_3_7-R1'] = 0x065C60, ['0_3_7-R3'] = 0x069190, ['0_3_DL-R1'] = 0x069340};
36-
fnSendInteriorChange = {['0_3_7-R1'] = 0x005740, ['0_3_7-R3'] = 0x005780, ['0_3_DL-R1'] = 0x0057C0};
37-
fnRequestClass = {['0_3_7-R1'] = 0x0056A0, ['0_3_7-R3'] = 0x0056E0, ['0_3_DL-R1'] = 0x005720};
38-
fnDisableScoreboard = {['0_3_7-R1'] = 0x06A320, ['0_3_7-R3'] = 0x06E270, ['0_3_DL-R1'] = 0x06E410};
39-
fnSetSpecialAction = {['0_3_7-R1'] = 0x0030C0, ['0_3_7-R3'] = 0x0030C0, ['0_3_DL-R1'] = 0x003110};
40-
41-
-- thanks Parazitas from ugbase.eu
42-
fnTakeScreenshot = {['0_3_7-R1'] = 0x070FC0, ['0_3_7-R3'] = 0x074EB0, ['0_3_DL-R1'] = 0x075040};
43-
-- fnDialogHook = {['0_3_7-R1'] = 0x06C040, ['0_3_7-R3'] = 0x06FF40, ['0_3_DL-R1'] = 0x0700D0};
19+
stChatInfo = {['0_3_7-R1'] = 0x21A0E4, ['0_3_7-R3'] = 0x26E8C8, ['0_3_DL-R1'] = 0x2ACA10, ['0_3_7-R4-2'] = 0x26E9F8};
20+
stInputInfo = {['0_3_7-R1'] = 0x21A0E8, ['0_3_7-R3'] = 0x26E8CC, ['0_3_DL-R1'] = 0x2ACA14, ['0_3_7-R4-2'] = 0x26E9FC};
21+
stKillInfo = {['0_3_7-R1'] = 0x21A0EC, ['0_3_7-R3'] = 0x26E8D0, ['0_3_DL-R1'] = 0x2ACA18, ['0_3_7-R4-2'] = 0x26EA00};
22+
stSAMP = {['0_3_7-R1'] = 0x21A0F8, ['0_3_7-R3'] = 0x26E8DC, ['0_3_DL-R1'] = 0x2ACA24, ['0_3_7-R4-2'] = 0x26EA0C};
23+
stScoreboardInfo = {['0_3_7-R1'] = 0x21A0B4, ['0_3_7-R3'] = 0x26E894, ['0_3_DL-R1'] = 0x2AC9DC, ['0_3_7-R4-2'] = 0x26E9C4};
24+
stDialogInfo = {['0_3_7-R1'] = 0x21A0B8, ['0_3_7-R3'] = 0x26E898, ['0_3_DL-R1'] = 0x2AC9E0, ['0_3_7-R4-2'] = 0x26E9C8};
25+
stGameInfo = {['0_3_7-R1'] = 0x21A10C, ['0_3_7-R3'] = 0x26E8F4, ['0_3_DL-R1'] = 0x2ACA3C, ['0_3_7-R4-2'] = 0x26EA24};
26+
27+
fnAddChatCmd = {['0_3_7-R1'] = 0x065AD0, ['0_3_7-R3'] = 0x069000, ['0_3_DL-R1'] = 0x0691B0, ['0_3_7-R4-2'] = 0x069770};
28+
fnRequestSpawn = {['0_3_7-R1'] = 0x003EC0, ['0_3_7-R3'] = 0x003ED0, ['0_3_DL-R1'] = 0x003F40, ['0_3_7-R4-2'] = 0x004060};
29+
fnSpawn = {['0_3_7-R1'] = 0x003AD0, ['0_3_7-R3'] = 0x003AD0, ['0_3_DL-R1'] = 0x003B20, ['0_3_7-R4-2'] = 0x003C20};
30+
fnAddChatMsg = {['0_3_7-R1'] = 0x064010, ['0_3_7-R3'] = 0x067460, ['0_3_DL-R1'] = 0x067650, ['0_3_7-R4-2'] = 0x067BE0};
31+
fnSetInputMode = {['0_3_7-R1'] = 0x09BD30, ['0_3_7-R3'] = 0x09FFE0, ['0_3_DL-R1'] = 0x0A0530, ['0_3_7-R4-2'] = 0x0A0750};
32+
fnUnlockActorCam = {['0_3_7-R1'] = 0x09BC10, ['0_3_7-R3'] = 0x09FEC0, ['0_3_DL-R1'] = 0x0A0410, ['0_3_7-R4-2'] = 0x0A0630};
33+
fnUpdateScoreboard = {['0_3_7-R1'] = 0x008A10, ['0_3_7-R3'] = 0x008BA0, ['0_3_DL-R1'] = 0x008C00, ['0_3_7-R4-2'] = 0x008F10};
34+
fnSay = {['0_3_7-R1'] = 0x0057F0, ['0_3_7-R3'] = 0x005820, ['0_3_DL-R1'] = 0x005860, ['0_3_7-R4-2'] = 0x005A10};
35+
fnSendCmd = {['0_3_7-R1'] = 0x065C60, ['0_3_7-R3'] = 0x069190, ['0_3_DL-R1'] = 0x069340, ['0_3_7-R4-2'] = 0x069900};
36+
fnSendInteriorChange = {['0_3_7-R1'] = 0x005740, ['0_3_7-R3'] = 0x005780, ['0_3_DL-R1'] = 0x0057C0, ['0_3_7-R4-2'] = 0x005970};
37+
fnRequestClass = {['0_3_7-R1'] = 0x0056A0, ['0_3_7-R3'] = 0x0056E0, ['0_3_DL-R1'] = 0x005720, ['0_3_7-R4-2'] = 0x0058D0};
38+
fnDisableScoreboard = {['0_3_7-R1'] = 0x06A320, ['0_3_7-R3'] = 0x06E270, ['0_3_DL-R1'] = 0x06E410, ['0_3_7-R4-2'] = 0x06E9E0};
39+
fnSetSpecialAction = {['0_3_7-R1'] = 0x0030C0, ['0_3_7-R3'] = 0x0030C0, ['0_3_DL-R1'] = 0x003110, ['0_3_7-R4-2'] = 0x0030F0};
40+
41+
fnTakeScreenshot = {['0_3_7-R1'] = 0x070FC0, ['0_3_7-R3'] = 0x074EB0, ['0_3_DL-R1'] = 0x075040, ['0_3_7-R4-2'] = 0x075620};
4442
};
4543

4644
local define = require( 'SA-MP API.samp.definitions' )
@@ -67,6 +65,8 @@ function module.GetIsAvailable()
6765
module.Version = '0_3_DL-R1'
6866
elseif ( cmp == 'E86D9A0A0083C41C85C0' ) then
6967
module.Version = '0_3_7-R3'
68+
elseif ( cmp == 'C07406889E3402000088' ) then
69+
module.Version = '0_3_7-R4-2'
7070
else
7171
error( 'Unknown SA-MP Version.' )
7272
end
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local module = {}
9+
10+
module.DialogStyle = {
11+
MsgBox = 0,
12+
Input = 1,
13+
List = 2,
14+
Password = 3,
15+
Tablist = 4,
16+
TablistHeaders = 5
17+
};
18+
19+
module.Limits = {
20+
MaxActors = 1000,
21+
MaxPlayers = 1004,
22+
MaxVehicles = 2000,
23+
MaxPickups = 4096,
24+
MaxObjects = 2100,
25+
MaxGangzones = 1024,
26+
Max3DTexts = 2048,
27+
MaxTextdraws = 2048,
28+
MaxPlayerTextdraws = 256,
29+
MaxClientCmds = 144,
30+
MaxMenus = 128,
31+
MaxPlayerName = 24,
32+
NicknameLength = 20,
33+
MaxMapicons = 100
34+
};
35+
36+
module.MessageType = {
37+
None = 0,
38+
Chat = 2,
39+
Info = 4,
40+
Debug = 8
41+
};
42+
43+
module.ChatDisplayMode = {
44+
Off = 0,
45+
Light = 1,
46+
Full = 2
47+
};
48+
49+
module.Gamestate = {
50+
WaitConnect = 9,
51+
Connecting = 13,
52+
AwaitJoin = 15,
53+
Connected = 14,
54+
Restarting = 18
55+
};
56+
57+
module.PlayerState ={
58+
None = 0,
59+
Wasted = 17,
60+
Passenger = 18,
61+
Driver = 19,
62+
Wasted = 32,
63+
Spawned = 31
64+
};
65+
66+
module.MarkersMode = {
67+
Off = 0,
68+
Global = 1,
69+
Streamed = 2
70+
};
71+
72+
module.SpecialAction = {
73+
None = 0,
74+
Duck = 1,
75+
UseJetpack = 2,
76+
EnterVehicle = 3,
77+
ExitVehicle = 4,
78+
Dance1 = 5,
79+
Dance2 = 6,
80+
Dance3 = 7,
81+
Dance4 = 8,
82+
Handsup = 9,
83+
UseCellphone = 10,
84+
Sitting = 11,
85+
StopUseCellphone = 12,
86+
DrinkBeer = 20,
87+
SmokeCiggy = 21,
88+
DrinkWine = 22,
89+
DrinkSprunk = 23,
90+
Cuffed = 24,
91+
Carry = 25
92+
};
93+
94+
return module
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.ffi.cdef[[
11+
struct stActorPool {
12+
int iLastActorID;
13+
stSAMPEntity *pActor[1000];
14+
int iIsListed[1000];
15+
struct actor_info *pGTAPed[1000];
16+
unsigned int ulUnk0[1000];
17+
unsigned int ulUnk1[1000];
18+
}__attribute__ ((packed));
19+
]]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.ffi.cdef[[
11+
struct stChatEntry {
12+
unsigned int SystemTime;
13+
char szPrefix[28];
14+
char szText[144];
15+
unsigned char unknown[64];
16+
int iType;
17+
unsigned int clTextColor;
18+
unsigned int clPrefixColor;
19+
}__attribute__ ((packed));
20+
]]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.safely_include 'SA-MP API.samp.0_3_7-R3.stChatEntry'
11+
sys.safely_include 'SA-MP API.samp.0_3_7-R3.stFontRenderer'
12+
13+
sys.ffi.cdef[[
14+
struct stChatInfo {
15+
int pagesize;
16+
char *pLastMsgText;
17+
int iChatWindowMode;
18+
unsigned char bTimestamps;
19+
unsigned int m_iLogFileExist;
20+
char logFilePathChatLog[0x104 + 1];
21+
void *pGameUI;
22+
void *pEditBackground;
23+
void *pDXUTScrollBar;
24+
unsigned int clTextColor;
25+
unsigned int clInfoColor;
26+
unsigned int clDebugColor;
27+
unsigned int m_lChatWindowBottom;
28+
29+
stChatEntry chatEntry[100];
30+
31+
stFontRenderer *m_pFontRenderer;
32+
void *m_pChatTextSprite;
33+
void *m_pSprite;
34+
void *m_pD3DDevice;
35+
int m_iRenderMode;
36+
void *pID3DXRenderToSurface;
37+
void *m_pTexture;
38+
void *pSurface;
39+
unsigned int *pD3DDisplayMode[4];
40+
int iUnk1[2];
41+
int m_iRedraw;
42+
long m_nPrevScrollBarPosition;
43+
long m_iFontSizeY;
44+
long m_iTimestampWidth;
45+
} __attribute__ ((packed));
46+
]]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.ffi.cdef[[
11+
struct stDialogInfo {
12+
void *m_pD3DDevice;
13+
int iTextPoxX;
14+
int iTextPoxY;
15+
unsigned int uiDialogSizeX;
16+
unsigned int uiDialogSizeY;
17+
int iBtnOffsetX;
18+
int iBtnOffsetY;
19+
void *pDialog;
20+
void *pList;
21+
void *pEditBox;
22+
int iIsActive;
23+
int iType;
24+
unsigned int DialogID;
25+
char *pText;
26+
unsigned int uiTextWidth;
27+
unsigned int uiTextHeight;
28+
char szCaption[65];
29+
int bServerside;
30+
char pad[536];
31+
}__attribute__ ((packed));
32+
]]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.ffi.cdef[[
11+
struct stFontRenderer {
12+
void *pChatFont;
13+
void *pLittleFont;
14+
void *pChatShadowFont;
15+
void *pLittleShadowFont;
16+
void *pCarNumberFont;
17+
void *pTempSprite;
18+
void *pD3DDevice;
19+
char *pszTextBuffer;
20+
21+
int m_nCharHeight;
22+
int m_nLittleCharHeight;
23+
24+
} __attribute__ ((packed));
25+
]]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
--[[
2+
Project: SA-MP-API
3+
4+
Author: Tim4ukys
5+
My url: vk.com/tim4ukys
6+
]]
7+
8+
local sys = require 'SA-MP API.kernel'
9+
10+
sys.safely_include 'SA-MP API.samp.0_3_7-R3.stSAMPPed'
11+
12+
sys.ffi.cdef[[
13+
struct stAudio
14+
{
15+
int iSoundState; // -- 0 - Finished, 1 - Loaded, 2 - Playing
16+
bool m_bOutdoorAmbienceTrackDisabled;
17+
}__attribute__ ((packed));
18+
19+
struct stCamera
20+
{
21+
void* pEntity; // -- mabe m_pAttachedTo
22+
struct CMatrix_Padded* matrix;
23+
}__attribute__ ((packed));
24+
25+
struct stGameInfo
26+
{
27+
struct stAudio* pAudio;
28+
struct stCamera* pCamera;
29+
stSAMPPed* pLocalPlayerPed;
30+
31+
// -- stracingCheckpoint | not tested
32+
float fRaceCheckpointPos[3];
33+
float fRaceCheckpointNext[3];
34+
float m_fRaceCheckpointSize;
35+
uint8_t byteRaceType;
36+
int bRaceCheckpointsEnabled;
37+
unsigned long dwRaceCheckpointMarker;
38+
unsigned long dwRaceCheckpointHandle;
39+
40+
// -- stCheckpoint | not tested
41+
float fCheckpointPos[3];
42+
float fCheckpointExtent[3];
43+
int bCheckpointsEnabled;
44+
unsigned long dwCheckpointMarker;
45+
46+
uint32_t ulUnk1;
47+
int bHeadMove;
48+
int nFrameLimit;
49+
int iCursorMode;
50+
int ulFpsLimit;
51+
int bClockEnabled;
52+
uint8_t byteUnk3;
53+
bool byteVehicleModels[212];
54+
}__attribute__ ((packed));
55+
]]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--[[
2+
Project: SA-MP API
3+
4+
Author: LUCHARE
5+
6+
7+
All structures are taken from mod_s0beit_sa.
8+
Copyright: BlastHack
9+
mod_sa is available from https://github.com/BlastHackNet/mod_s0beit_sa/
10+
]]
11+
12+
local sys = require 'SA-MP API.kernel'
13+
14+
sys.ffi.cdef[[
15+
struct stGangzone {
16+
float fPosition[4]; // -- left, bottom, right, top
17+
unsigned int dwColor;
18+
unsigned int dwAltColor;
19+
}__attribute__ ((packed));
20+
]]

0 commit comments

Comments
 (0)