CLEO Help How to get player's id from sent message

CLEO related
Status
Not open for further replies.

Verox

New member
Joined
Jun 2, 2019
Messages
4
Reaction score
0
Hello, i want to get the ID of the player who sent me message ..

First i want to detect that the player sent me a message then answer him using his ID !


Here's what i was able to make :

Bash:
IF
            0AD4: $NOT_USED2 = scan_string 0@ format "SMS from %s" $NOT_USED2
                THEN
                wait 1000
                format 5@ "/sms (PLAYERS ID) Hello!(HERE I WANT PLAYER'S ID) Currently I'm AFK. You've just send me a message"
                say 5@

Can someone help me by completing it ?
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
You got samp funcs right? There was a function called SAMP.GetPlayerIDFromName or sometyhing.
Just type in SAMP. and it will show in sanny builder.
Alternatively, use ctrl + alt + 2 to show all opcode list and try to search something like polayer id there.

There was a function, however if the SMS from "blabla" like as in a roleplay name, contains a space, then you will have to convert it into underscore, so its more work sadly.

You could loop through all players and find closest match but meh dont, its inefficient.
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
This is cleo help, not request. This also got requested 100000 times, so make your try and we will help
 
Last edited:
  • Like
Reactions: ini

ThewarII

Member
Joined
Mar 28, 2016
Messages
18
Reaction score
0
0B20: samp 1@ = actor_handle_by_samp_player_id 0@
From Player_ID (is 0@) to Actor_Handle and store it to 1@

or

0B2B: samp 0@ = get_player_id_by_actor_handle 1@
From Actor_Handle (is 1@) to Player_ID and store it to 0@

if you have Actor_Handle or Player_ID then store different way with this.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
2@ = NickName
PHP:
:getPlayerIdByName
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C14: strcmp string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@
 
Last edited:
Status
Not open for further replies.
Top