Hello ladies and gents!
I have a quick question, would it be easy for me, as a person who has messed with lua very limited, just switched some weapons onto other aircraft , to create a lua script with a command like "-admin say stop fighting or a ban for both of you!" to make that text into a text box like a trigger function on the mission editor at the top right of the screen? Or, with the default settings of Slmod, at the top right when you type -admin. You get the gist... And if it's easy enough, can you post the command here? I'll try to do my best and experiment with it, but until then, I'm kind of desperate . Thanks!
EDIT:
I'll pay a few bucks just to have this command, and to have it private, just for my server .
EDIT #2:
Quote:
local ToggleSayVars = {}
ToggleSayVars.menu = SlmodAdminMenu
ToggleSayVars.description = 'Say in chat "-admin say" to tell everybody on the server something.'
ToggleSayVars.active = true
ToggleSayVars.options = {display_mode = 'chat', display_time = 5, privacy = {access = true, show = true}}
ToggleSayVars.selCmds = {
[1] = {
[1] = {
type = 'word',
text = '-admin',
required = true
},
[2] = {
type = 'word',
text = 'say',
required = true
},
[3] = {
type = 'word',
text = 'admintext',
required = true
}.
}
}
local AdminName
if client_id == 1 then
AdminName = net.get_name(1)
elseif slmod.clients[client_id] and slmod.clients[client_id].ucid and Admins[slmod.clients[client_id].ucid] then
AdminName = Admins[slmod.clients[client_id].ucid]
else
AdminName = '!UNKNOWN ADMIN!' -- should NEVER get to this.
end
if net.is_paused() then
net.resume()
slmod.scheduleFunctionByRt(slmod.basicChat, {'Slmod: admin "' .. AdminName .. '" said "'admintext'"'}, net.get_real_time() + 0.1) -- scheduled so that reply from Slmod appears after your chat message.
end
AdminItems[#AdminItems + 1] = SlmodMenuItem.create(ToggleSayVars) -- add the item into the items table.
This is in the adminmenu file.
What do I need to change here so that it works?...
-Prey