Put EXACTLY what the server says when a player offers you a gun.
Here is a code to test it: it will read the last line on the chat, i don't know how to read other.
Writing "pepe" as a cheat for SP the cleo add a message to the chat (client not server). The cleo will read the last line (the message) then add other message and send the command.
Code:
{$CLEO .cs}
0000: NOP
:PEPE_26
wait 0
if
0ADC: test_cheat "pepe"
else_jump @PEPE_39
0AF8: "Arms dealer: pepeelpubero - ID 29 - offered you a M4 for 1$. Use (/accept gun)" 0xCF0300 //this will add a message to the chat simulating the
server msg when a player offers you a gun
goto @PEPE_26
:PEPE_39
wait 500
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 99 to 0@
if
0AD4: 30@ = scan_string 0@ format "Arms dealer: pepeelpubero - ID %d - offered you a M4 for 1$. Use (/accept gun id)" 5@ // this will read
the message from the chat, the one we put above
else_jump @PEPE_26
0AF9: "/accept gun %d" 5@ //this will send the command with the id of the player who offers you a gun
0AF8: "You have accepted the gun from the player ID %d" 0xCF0300 5@
0AC9: free_allocated_memory 0@
goto @PEPE_39
: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@
Here is an example of what we are doing:
below or above of "You have accepted the gun from the player ID" will send the command /accept gun id <- here is id 14.
But i don't know how to get the player name or read other line, if i put %s gives me two warnings.