CLEO Help Help sannybuilder

CLEO related
Status
Not open for further replies.

oMiCRoN

Member
Joined
Dec 7, 2018
Messages
11
Reaction score
1
How can i do a text including my id? Example:

:cmd_1
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
0AF9: samp say_msg "Hi, my id is %d" 21@
end
SAMP.CmdRet()
And show in chat: Hi, my id is 1 or other id, my id in game, like if i have 685 id: "Hi, my id is 685" and the command be /myid without to put id after command (/myid).
I mean when i use /myid to say in chat "Hi, my id is (my id)"
I tried all variables, many opcodes and it no works, in .lua mod is like this:
local _, myId = sampGetPlayerIdByCharHandle(playerPed)
imgui.Text(string.format("text", sampGetPlayerNickname(myId)))
imgui.Text(u8(string.format('%s', os.date())))
How can i do this in sanny builder? i tried all things
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
SAMP.IsCommandTyped(0@)
If
0AD4: $NOT_USED = scan_string 0@ format "%d" 1@
Then
0B36: samp 2@ = get_player_nickname 1@
0B2B: samp 3@ = get_player_id_by_actor_handle 2@
say "player id: %d" 3@
end
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Code:
{$CLEO}
0000:

repeat         
wait 50
until 0AFA:  is_samp_available

0B34: samp register_client_command "myid" to_label @cmd_print_my_id
0B34: samp register_client_command "param" to_label @cmd_print_parameter


while true
wait 0

end


:cmd_print_my_id
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR
chatmsg "My id is %d" {color} -1 {id} 0@
samp.CmdRet()


:cmd_print_parameter
0B35: samp 0@ = get_last_command_params
if 0AD4: $NOT_USED = scan_string 0@ format "%d" 1@ //IF and SET
then
chatmsg "Command parameter is %d" {white color} -1 {param} 1@
else
chatmsg "Format is: /param <number>" {red color} 0xFF2222
end
samp.CmdRet()
 

oMiCRoN

Member
Joined
Dec 7, 2018
Messages
11
Reaction score
1
But how can i do to say the name and not the id? Like when i type /command to say in chat "Hi, my name is (my name in-game)"?

I tried many ways but i can't do it...
That's one of my scripts (ways) i tried..:
:cmd_1
SAMP.IsCommandTyped(0@)
0B2B: samp 1@ = get_player_nickname_by_actor_handle $PLAYER_ACTOR
chatmsg "Hi, my name is %s" -1 1@
SAMP.CmdRet()

For id is:

:cmd_1
SAMP.IsCommandTyped(0@)
0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
chatmsg "Hi, my id is %d" -1 1@
SAMP.CmdRet()

This is working (for id script)

kazkaS
@kazkaS
monday
@monday
if you know or other guys
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
get_player_nickname_by_actor_handle
text preceding variables in cleo is just for description xD (except labels/defines)
It won't affect what the opcode actually does, it's all about the opcode itself (e.g. 0B2B) and its' parameters (e.g. 1@)

You could try this:
0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 2@ = get_player_nickname 1@
chatmsg "Hi, my name is %s" -1 2@

Btw, samp opcodes (that refer to "player") mostly require samp ID (which you can see in the scoreboard),
Gta opcodes (that refer to "actor") require internal gta identifier (which is not the ID you see in the scoreboard, it's a different thing, it's just the identifier to find the data of the actor in game memory).
$PLAYER_ACTOR is the identifier of your dude (but it is not samp ID)
 

oMiCRoN

Member
Joined
Dec 7, 2018
Messages
11
Reaction score
1
Damn man, you are god, it works
about this:
text preceding variables in cleo is just for description xD (except labels/defines)
It won't affect what the opcode actually does, it's all about the opcode itself (e.g. 0B2B) and its' parameters (e.g. 1@)
i didn't know xD thank you for the solve and for the information bro, respect
 
Status
Not open for further replies.
Top