CLEO Help Get player id

CLEO related
Status
Not open for further replies.

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
How can i get the id of the player who sends me a /pm ?
I want to create a cleo that will /pm the person who just sent me a /pm

[member=111]springfield[/member]
I didnt see any snippets regarding this topic
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Depends on the text format.
First you should read the chatline, then use 0AD4 to scan the string with a predefined format.
Then make a loop and use stricmp/strcmp to compare the name of every player on the server with the one from the text.
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
Put the chatlog line (samp/chatlog.txt) and also a pic if you can, then we can try to do it. If you want an activation key (on/off) or always activated (when the cleo reads the line send something), also tell us that.

And yes, there is a snippet to read chat lines (without SF) and an opcode to do it (SF needed). http://ugbase.eu/snippets/getchatentrytext/ <- 0.3z R1
 

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
reg chat
[11:07:17] {FFFFFF}SA-MP {B9C9BF}0.3z {FFFFFF}Started

[11:07:17] > ================================== <

[11:07:17] > SAMPFUNCS v4.0 for SA:MP 0.3z started.

[11:07:17] > Developers: FYP, Dark_Knight

[11:07:17] > BlastHack © 2013-2014

[11:07:17] > Website: http://blasthack.net

[11:07:17] > ================================== <

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:20] Connecting to 176.31.104.88:8888...

[11:07:21] Connected. Joining the game...

[11:07:24] Connected to {B9C9BF}• COD5 • LS-Cops and Robbers • cod5samp.com

[11:07:25] [THC]xZeus[TA](48): {FFFFFF}haha

[11:07:25] Bung_[FpZ](18): {FFFFFF}lol ALONGut

[11:07:28] SERVER: You are logged into your account.

[11:07:28] Script Version: 2.20 Last Update: 24th December 2014

[11:07:28] Teamspeak IP: ts.cod5samp.com

[11:07:28] ______________________________________________________________

[11:07:28] HOUSE: {FFFFFF}You own a VIP Mansion.

[11:07:28] [GBC]hindi(85): {FFFFFF}sory

[11:07:29] [THC]xZeus[TA](48): {FFFFFF}i better die xd

[11:07:34] [THC]xZeus[TA](48): {FFFFFF}i'm too far from NG base

some PMs
[11:09:14] PM from player[110]: message here
[11:10:46] PM from [90]player: message here
[11:15:43] PM from player[37]: message here
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
I think this must work but is not working, if anyone can fix the code then it must send the autopm. Also post a pic of a pm in game and the part of that pm in chatlog.txt because maybe is needed the color of the line. ALT+1 = ON/OFF

Code:
{$CLEO .cs}

0000: NOP

:PEPE_255
wait 0
if and
0AB0: 18
0AB0: 49 
jf @PEPE_39
if
31@ == 0
then
wait 200
31@ = 1  
0ACD: show_text_highpriority "AUTO PM ~g~ENABLED" time 1000
else
wait 200     
31@ = 0
0ACD: show_text_highpriority "AUTO PM ~r~DISABLED" time 1000
end

:PEPE_39
wait 0 
if
31@ == 1
jf @PEPE_255   
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 99 to 0@
if 
0AD4: 30@ = scan_string 0@ format "PM from [%d]%s: %s" 28@ 25@v 24@v
else_jump @PEPE_255
0AF9: "/pm %d I got my autopm activated." 28@ 
0AC9: free_allocated_memory 0@     
jump @PEPE_255

:getChatEntryText
wait 500
0AA2: 1@ = "samp.dll"
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 
005A: 1@ += 0@
1@ += 28
0AB2: ret 1 1@
 

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
doesnt work
also this is the exact layout of the chatlog.txt

iAnthony link said:
reg chat
[11:07:17] {FFFFFF}SA-MP {B9C9BF}0.3z {FFFFFF}Started

[11:07:17] > ================================== <

[11:07:17] > SAMPFUNCS v4.0 for SA:MP 0.3z started.

[11:07:17] > Developers: FYP, Dark_Knight

[11:07:17] > BlastHack © 2013-2014

[11:07:17] > Website: http://blasthack.net

[11:07:17] > ================================== <

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:18] KMF - Damage informer - 0.3z(RENKO)

[11:07:20] Connecting to 176.31.104.88:8888...

[11:07:21] Connected. Joining the game...

[11:07:24] Connected to {B9C9BF}• COD5 • LS-Cops and Robbers • cod5samp.com

[11:07:25] [THC]xZeus[TA](48): {FFFFFF}haha

[11:07:25] Bung_[FpZ](18): {FFFFFF}lol ALONGut

[11:07:28] SERVER: You are logged into your account.

[11:07:28] Script Version: 2.20 Last Update: 24th December 2014

[11:07:28] Teamspeak IP: ts.cod5samp.com

[11:07:28] ______________________________________________________________

[11:07:28] HOUSE: {FFFFFF}You own a VIP Mansion.

[11:07:28] [GBC]hindi(85): {FFFFFF}sory

[11:07:29] [THC]xZeus[TA](48): {FFFFFF}i better die xd

[11:07:34] [THC]xZeus[TA](48): {FFFFFF}i'm too far from NG base

some PMs
[11:09:14] PM from player[110]: message here
[11:10:46] PM from [90]player: message here
[11:15:43] PM from player[37]: message here
 
Status
Not open for further replies.
Top