Skip to content

Commit 8a2e46f

Browse files
committed
Update init.lua
1 parent f2f12fc commit 8a2e46f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

SA-MP API/init.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local mem = require( 'memory' )
99
local ffi = require( 'ffi' )
1010

1111
local module = {
12-
_version = 2.2,
12+
_version = 2.3,
1313

1414
Version = nil,
1515
Handle = 0x0,
@@ -46,6 +46,8 @@ local offset = {
4646
stAudioStream = {['0_3_7-R1'] = 0x21A0F0, ['0_3_7-R3'] = 0x26E8D4, ['0_3_DL-R1'] = 0x2ACA1C, ['0_3_7-R4-2'] = 0x26EA04};
4747
fnAudioStreamPlay = {['0_3_7-R1'] = 0x062DA0, ['0_3_7-R3'] = 0x0661F0, ['0_3_DL-R1'] = 0x0663E0, ['0_3_7-R4-2'] = 0x066960};
4848
fnAudioStreamStop = {['0_3_7-R1'] = 0x0629A0, ['0_3_7-R3'] = 0x065DF0, ['0_3_DL-R1'] = 0x065FE0, ['0_3_7-R4-2'] = 0x066560};
49+
50+
fnGetPlayerName = {['0_3_7-R1'] = 0x013CE0, ['0_3_7-R3'] = 0x016F00, ['0_3_DL-R1'] = 0x0170D0, ['0_3_7-R4-2'] = 0x0175C0};
4951
};
5052

5153
local define = require( 'SA-MP API.samp.definitions' )
@@ -308,4 +310,13 @@ function module.StopAudioStream( bWait )
308310
return ffi.cast( 'int ( __thiscall* )( void *, bool )', module.Handle + offset.fnAudioStreamStop[module.Version] )( this, bWait )
309311
end
310312

313+
-- Update v2.3(Aug 24, 2021)
314+
315+
function module.GetPlayerName( Id )
316+
local this = module.Get().pBase.pPools.pPlayer
317+
if ( this == 0x0 ) then return end
318+
319+
return ffi.cast( 'const char* ( __thiscall* )( void*, unsigned short )', module.Handle + offset.fnGetPlayerName[module.Version] )( this, Id )
320+
end
321+
311322
return module

0 commit comments

Comments
 (0)