{$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?
// 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?