CLEO Help Capture Phone Number

CLEO related

Grecu

Member
Joined
Aug 16, 2024
Messages
7
Reaction score
0
{$CLEO .cs}


// Register commands
0B34: samp register_client_command "smsid" to_label @cmd_smsid


// Command handling for /smsid
:cmd_smsid
SAMP.IsCommandTyped(20@)
0AD4: 20@ = scan_string 20@ format "%d %s" 21@ 22@

if
0AD4: 21@ > 0 // Check if a valid player ID is provided
then
0B36: samp 1@ = get_player_nickname 21@ // Get the player's nickname using the ID
0B2C: samp send_client_command "/number %d" 21@ // Simulate the /number command
wait 1000 // Wait for the response to be processed

// Assuming the phone number is stored in a variable
// You might need a custom function here to capture the phone number from the chatbox or similar

// Simulate sending SMS using the retrieved phone number
0B2C: samp send_client_command "/sms %d %s" 1@ 22@
chatmsg "SMS sent to %d: %s" 1@ 22@ // Notify the user
else
chatmsg "Invalid Player ID. Syntax: /smsid <player id> <message>"
end

SAMP.CmdRet() // Ends the custom command processing



The code is generated with ChatGPT and I tried to find a solution to capture the phone number, brief explanation for the use of the code,
On the server there is this comand /sms <phone number> <message> and this command /number <player id> that shows you the player phone number, it is possible to whrite a script where I type /sms <player id> <message> and will send that message?
 

ZyZ.MaxiM

Active member
Joined
Nov 14, 2022
Messages
94
Solutions
2
Reaction score
4
{$CLEO .cs}


// Register commands
0B34: samp register_client_command "smsid" to_label @cmd_smsid


// Command handling for /smsid
:cmd_smsid
SAMP.IsCommandTyped(20@)
0AD4: 20@ = scan_string 20@ format "%d %s" 21@ 22@

if
0AD4: 21@ > 0 // Check if a valid player ID is provided
then
0B36: samp 1@ = get_player_nickname 21@ // Get the player's nickname using the ID
0B2C: samp send_client_command "/number %d" 21@ // Simulate the /number command
wait 1000 // Wait for the response to be processed

// Assuming the phone number is stored in a variable
// You might need a custom function here to capture the phone number from the chatbox or similar

// Simulate sending SMS using the retrieved phone number
0B2C: samp send_client_command "/sms %d %s" 1@ 22@
chatmsg "SMS sent to %d: %s" 1@ 22@ // Notify the user
else
chatmsg "Invalid Player ID. Syntax: /smsid <player id> <message>"
end

SAMP.CmdRet() // Ends the custom command processing



The code is generated with ChatGPT and I tried to find a solution to capture the phone number, brief explanation for the use of the code,
On the server there is this comand /sms <phone number> <message> and this command /number <player id> that shows you the player phone number, it is possible to whrite a script where I type /sms <player id> <message> and will send that message?
Chatgpt insn t so good with sanny builder, wait till someone can help you out.
 

Grecu

Member
Joined
Aug 16, 2024
Messages
7
Reaction score
0
{$CLEO .cs}
0662: "Grecu"
wait 2500
0B34: samp register_client_command "smsid" to_label @cmd_1

0AB1: call_scm_func @chatmsg 0

:cmd_1
SAMP.IsCommandTyped(20@)
if

0AB4: get_string_part 20@ start 5 length 1000 to 21@


0AD4: 22@ = scan_string 21@ format "%d"
0AF9: samp say_msg "/number %d" 22@
wait 1000
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
0004: get_string_part string1 0@ find_position_of_character ':' store_to &0
000A: 25@ = get_int_from_string string1 0@ from_position &0+2 format "%d"

0AB4: get_string_part 21@ start 0 length 3 to 23@


0AB4: get_string_part 20@ start 5 + length of 23@ + 1 length 1000 to 24@
then

0AF9: samp say_msg "/sms %d %s" 25@ 24@

else
print "~y~/smsid + <id jucatorului> + <mesaj>" 2000
end
SAMP.CmdRet()

:chatmsg
0AA2: 0@ = load_library "samp.dll"
0085: 1@ = 0@
1@ += 2203876
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1
0085: 2@ = 0@
2@ += 409616
chatmsg "{ff0099}SMSid By Grecu" -1
0AB2: ret 0
this is a code modified by me, and i will explain why I searched for ":" in the code
 

Grecu

Member
Joined
Aug 16, 2024
Messages
7
Reaction score
0
1723835341548.png
the phone number will always be after ":"
And the I get this error when I am trying to compile it, "Too many actual parameters. Expected 0 params."
 

Your Boss

Member
Joined
Mar 10, 2016
Messages
9
Reaction score
2
View attachment 6599
the phone number will always be after ":"
And the I get this error when I am trying to compile it, "Too many actual parameters. Expected 0 params."
idk try it
0662: "Grecu"
wait 2500
0B34: samp register_client_command "smsid" to_label @cmd_1

0AB1: call_scm_func @chatmsg 0

:cmd_1
SAMP.IsCommandTyped(20@)
if
0AB4: get_string_part 20@ start 5 length 1000 to 21@
0AD4: 22@ = scan_string 21@ format "%d"
0AF9: samp say_msg "/number %d" 22@
wait 1000
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
0004: get_string_part string1 0@ find_position_of_character ':' store_to &0
000A: 25@ = get_int_from_string string1 0@ from_position &0+2 format "%d"
0AB4: get_string_part 21@ start 0 length 3 to 23@
0AB4: get_string_part 20@ start 5 + length of 23@ + 1 length 1000 to 24@
0AF9: samp say_msg "/sms %d %s" 25@ 24@
else
print "~y~/smsid + <id jucatorului> + <mesaj>" 2000
end

SAMP.CmdRet()

:chatmsg
0AA2: 0@ = load_library "samp.dll"
0085: 1@ = 0@
1@ += 2203876
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1
0085: 2@ = 0@
2@ += 409616
0AC9: samp add_message_to_chat "{ff0099}SMSid By Grecu" color -1
0AB2: ret 0
 

Ice555

Active member
Joined
Mar 11, 2021
Messages
49
Solutions
3
Reaction score
7
Location
Lithuania
idk try it
0662: "Grecu"
wait 2500
0B34: samp register_client_command "smsid" to_label @cmd_1

0AB1: call_scm_func @chatmsg 0

:cmd_1
SAMP.IsCommandTyped(20@)
if
0AB4: get_string_part 20@ start 5 length 1000 to 21@
0AD4: 22@ = scan_string 21@ format "%d"
0AF9: samp say_msg "/number %d" 22@
wait 1000
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
0004: get_string_part string1 0@ find_position_of_character ':' store_to &0
000A: 25@ = get_int_from_string string1 0@ from_position &0+2 format "%d"
0AB4: get_string_part 21@ start 0 length 3 to 23@
0AB4: get_string_part 20@ start 5 + length of 23@ + 1 length 1000 to 24@
0AF9: samp say_msg "/sms %d %s" 25@ 24@
else
print "~y~/smsid + <id jucatorului> + <mesaj>" 2000
end

SAMP.CmdRet()

:chatmsg
0AA2: 0@ = load_library "samp.dll"
0085: 1@ = 0@
1@ += 2203876
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1
0085: 2@ = 0@
2@ += 409616
0AC9: samp add_message_to_chat "{ff0099}SMSid By Grecu" color -1
0AB2: ret 0
Dont send shit chat gpt codes, most of opcodes probably dont work. Try this @Grecu. //sms id message
 

Attachments

  • sms.cs
    26.9 KB · Views: 14

Grecu

Member
Joined
Aug 16, 2024
Messages
7
Reaction score
0
Dont send shit chat gpt codes, most of opcodes probably dont work. Try this @Grecu. //sms id message
I tried the command is there because when I type //sms I don't get an error message from the server that the command doesn't exist, but it doesn't work, I am really thankfull that you tried, it is ok, I kinda gave up on the idea of this mod
 

Ice555

Active member
Joined
Mar 11, 2021
Messages
49
Solutions
3
Reaction score
7
Location
Lithuania
I tried the command is there because when I type //sms I don't get an error message from the server that the command doesn't exist, but it doesn't work, I am really thankfull that you tried, it is ok, I kinda gave up on the idea of this mod
give server ip, il make it on free day.
 
Top