[SNIPPET] Get LocalPlayer Name / ID

With this snippet we can get nick name.
Good luck...​



Explain with 0.3.7 .:
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa:

WHILE TRUE
wait 0

call @Get_LocalPlayer_Name 0 0@
chatmsg "%s" -1 0@

END

:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_My_NickName 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0xA //szLocalPlayerName
0AB2: ret 1 0@



Snippets.:


0.3.7
PHP:
:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0xA //szLocalPlayerName
0AB2: ret 1 0@

0.3.7
PHP:
:Get_LocalPlayer_ID
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 1 vp 0 //stPlayerPools
0@ += 0x4 //sLocalPlayerID
0AB2: ret 1 0@


0.3.7-R2
PHP:
:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x21A100
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3C5
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0x6 //szLocalPlayerName
0AB2: ret 1 0@

0.3.7-R2
PHP:
:Get_LocalPlayer_ID
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x21A100
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3C5
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 1 vp 0 //stPlayerPools
0@ += 0x0 //sLocalPlayerID
0AB2: ret 1 0@


0.3.7-R3
PHP:
:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x26E8DC
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0x2F22 //szLocalPlayerName
0AB2: ret 1 0@

0.3.7-R3
PHP:
:Get_LocalPlayer_ID
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x26E8DC
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 1 vp 0 //stPlayerPools
0@ += 0x2F1C //sLocalPlayerID
0AB2: ret 1 0@


0.3.7-R4
PHP:
:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x26EA0C
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0x12 //szLocalPlayerName
0AB2: ret 1 0@

0.3.7-R4
PHP:
:Get_LocalPlayer_ID
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x26EA0C
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 1 vp 0 //stPlayerPools
0@ += 0xC //sLocalPlayerID
0AB2: ret 1 0@


0.3.DL
PHP:
:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x2ACA24
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0x6 //szLocalPlayerName
0AB2: ret 1 0@

0.3.DL
PHP:
:Get_LocalPlayer_ID
/// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset        
0@ += 0x2ACA24
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 1 vp 0 //stPlayerPools
0@ += 0x0 //sLocalPlayerID
0AB2: ret 1 0@
 
Last edited:

xHype

Member
Joined
Aug 28, 2019
Messages
19
Reaction score
2
for what sz and st or s stands?
btw. thanks for sharing.
 

tieuthienthan

Active member
Joined
Nov 6, 2019
Messages
43
Reaction score
10
Location
Vietnam
0.3DL
Only works if local name's length is under 16 characters
If the local name is over 15 characters, it will return some random string like "@¸A = ð·("
Proof:

Code:
{$CLEO .cs}
0000: 

wait 10000
wait 4000
while true
wait 1000
0AC8: 0@ = 260
0AC8: 31@ = 260
0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@    
0AD3: 31@ = format "Name:<%s>" 0@
0AB1: @SendChatMsg 2 color 0xFFFF0000 text 31@
0AC9: 0@
0AC9: 31@
end
:SendChatMsg
if 0AA2: 2@ = "samp.dll"
then
    0085: 3@ = 2@
    3@ += 0x2ACA10
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += 0x67650 
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
end
0AB2: 0

:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_LocalPlayer_ID 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset         
0@ += 0x2ACA24
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo 
0@ += 0x3DE
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0x6 //szLocalPlayerName
0AB2: ret 1 0@

When name is: maxchar_possibl (15 characters)
When name is:maxchar_possible (16 characters)

Could you please fix this problem?
 

Attachments

  • 1598868470988.png
    1598868470988.png
    20.9 KB · Views: 38
  • 1598868556070.png
    1598868556070.png
    30.4 KB · Views: 36
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
0.3DL
Only works if local name's length is under 16 characters
If the local name is over 15 characters, it will return some random string like "@¸A = ð·("

When name is: maxchar_possibl (15 characters)
When name is:maxchar_possible (16 characters)

Could you please fix this problem?

PHP:
:Get_Local_Player_Name
/// 0AB1: @Get_Local_Player_Name 1 SampVersionID 3 _Returned: Name 1@
IF 0AA2: 1@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 2@ = 1@ + 0x219A6F
    END
 
    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 2@ = 1@ + 0x219A77
    END
 
    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 2@ = 1@ + 0x2AC187
    END
 
    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 2@ = 1@ + 0x26E03F
    END
 
    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 2@ = 1@ + 0x26E16F
    END
END
0AB2: ret 1 2@

If you need some others snippets from samp DL , you can check my AutoLogin v4 source.
 
Last edited:
Top