Help sannybuilder

Joined
Dec 7, 2018
Messages
11
Likes
1
Points
3
#1
How can i do a text including my id? Example:

:cmd_1
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "Hi, my id is %d" [email protected]
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
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
950
Likes
15
Points
68
#4
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 [email protected] = get_player_id_by_actor_handle $PLAYER_ACTOR
chatmsg "My id is %d" {color} -1 {id} [email protected]
samp.CmdRet()


:cmd_print_parameter
0B35: samp [email protected] = get_last_command_params
if 0AD4: $NOT_USED = scan_string [email protected] format "%d" [email protected] //IF and SET
then
chatmsg "Command parameter is %d" {white color} -1 {param} [email protected]
else
chatmsg "Format is: /param <number>" {red color} 0xFF2222
end
samp.CmdRet()
 
OP
OP
O
Joined
Dec 7, 2018
Messages
11
Likes
1
Points
3
#6
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([email protected])
0B2B: samp [email protected] = get_player_nickname_by_actor_handle $PLAYER_ACTOR
chatmsg "Hi, my name is %s" -1 [email protected]
SAMP.CmdRet()

For id is:

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

This is working (for id script)

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

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
950
Likes
15
Points
68
#9
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. [email protected])

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

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)
 
OP
OP
O
Joined
Dec 7, 2018
Messages
11
Likes
1
Points
3
#10
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. [email protected])
i didn't know xD thank you for the solve and for the information bro, respect
 
Top