Hello, I want to make a command where it pulls the message like this
"Player's phone number is: xxxxxx". I want to create it for a mod that is being used /smss id number
function onSMSSCommand(cmd)
local id, message = cmd:match("^(%d+) (.+)$")
id = tonumber(id)
if id and message then
local playerNumber = getPlayerNumber(id)
if playerNumber then
local smsCommand = string.format("/sms %s %s", playerNumber, message)
sampSendChat(smsCommand)
else
sampAddChatMessage("Try again to send /smss.", -1)
end
else
sampAddChatMessage("Invalid command usage. Use /smss <id> <message>", -1)
end
end
A snippet from that mod that I'm trying to make.
"Player's phone number is: xxxxxx". I want to create it for a mod that is being used /smss id number
function onSMSSCommand(cmd)
local id, message = cmd:match("^(%d+) (.+)$")
id = tonumber(id)
if id and message then
local playerNumber = getPlayerNumber(id)
if playerNumber then
local smsCommand = string.format("/sms %s %s", playerNumber, message)
sampSendChat(smsCommand)
else
sampAddChatMessage("Try again to send /smss.", -1)
end
else
sampAddChatMessage("Invalid command usage. Use /smss <id> <message>", -1)
end
end
A snippet from that mod that I'm trying to make.