@@ -9,7 +9,7 @@ local mem = require( 'memory' )
99local ffi = require ( ' ffi' )
1010
1111local module = {
12- _version = 2.1 ,
12+ _version = 2.2 ,
1313
1414 Version = nil ,
1515 Handle = 0x0 ,
@@ -42,6 +42,10 @@ local offset = {
4242 fnTakeScreenshot = {[' 0_3_7-R1' ] = 0x070FC0 , [' 0_3_7-R3' ] = 0x074EB0 , [' 0_3_DL-R1' ] = 0x075040 , [' 0_3_7-R4-2' ] = 0x075620 };
4343 -- Update v2.1(Aug 23, 2021)
4444 fnShowDialog = {[' 0_3_7-R1' ] = 0x06B9C0 , [' 0_3_7-R3' ] = 0x06F8C0 , [' 0_3_DL-R1' ] = 0x06FA50 , [' 0_3_7-R4-2' ] = 0x070010 };
45+ -- Update v2.2(Aug 24, 2021)
46+ stAudioStream = {[' 0_3_7-R1' ] = 0x21A0F0 , [' 0_3_7-R3' ] = 0x26E8D4 , [' 0_3_DL-R1' ] = 0x2ACA1C , [' 0_3_7-R4-2' ] = 0x26EA04 };
47+ fnAudioStreamPlay = {[' 0_3_7-R1' ] = 0x062DA0 , [' 0_3_7-R3' ] = 0x0661F0 , [' 0_3_DL-R1' ] = 0x0663E0 , [' 0_3_7-R4-2' ] = 0x066960 };
48+ fnAudioStreamStop = {[' 0_3_7-R1' ] = 0x0629A0 , [' 0_3_7-R3' ] = 0x065DF0 , [' 0_3_DL-R1' ] = 0x065FE0 , [' 0_3_7-R4-2' ] = 0x066560 };
4549};
4650
4751local define = require ( ' SA-MP API.samp.definitions' )
@@ -288,4 +292,20 @@ function module.GetCurrentWeaponID( )
288292 return this .byteCurrentWeapon
289293end
290294
295+ -- Update v2.2(Aug 24, 2021)
296+
297+ function module .PlayAudioStream ( szUrl , posX , posY , posZ , fRadius , bIs3d )
298+ local this = ffi .cast ( ' void**' , module .Handle + offset [' stAudioStream' ][module .Version ] )
299+ if ( this == 0x0 ) then return end
300+
301+ return ffi .cast ( ' int ( __thiscall* )( void *, const char*, float, float, float, float, bool )' , module .Handle + offset .fnAudioStreamPlay [module .Version ] )( this , szUrl , posX , posY , posZ , fRadius , bIs3d )
302+ end
303+
304+ function module .StopAudioStream ( bWait )
305+ local this = ffi .cast ( ' void**' , module .Handle + offset [' stAudioStream' ][module .Version ] )
306+ if ( this == 0x0 ) then return end
307+
308+ return ffi .cast ( ' int ( __thiscall* )( void *, bool )' , module .Handle + offset .fnAudioStreamStop [module .Version ] )( this , bWait )
309+ end
310+
291311return module
0 commit comments