• How can i make another advert command named Comms
    3 replies, posted
I wanna make another chat command similar to advert but instead of it showing up as [Advert] i want it to show up as [Comms] And the command will be /comms The colour will be green Can anyone help?
PlayerSay, Net Library and Chat.AddText or SendLua and Chat.AddText
Copy [URL="https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/chat/sv_chatcommands.lua#L107-L124"]this[/URL] [code] local function PlayerAdvertise(ply, args) if args == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return "" end local DoSay = function(text) if text == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return end for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) DarkRP.talkToPerson(v, col, DarkRP.getPhrase("advert") .. " " .. ply:Nick(), Color(255, 255, 0, 255), text, ply) end end return args, DoSay end DarkRP.defineChatCommand("advert", PlayerAdvertise, 1.5) [/code]
WHat do i edit doe [editline]16th December 2015[/editline] [CODE]local function PlayerAdvertise(ply, args) if args == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return "" end local DoSay = function(text) if text == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return end for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) DarkRP.talkToPerson(v, col, DarkRP.getPhrase("comms") .. " " .. ply:Nick(), Color(0, 255, 0, 255), text, ply) end end return args, DoSay end DarkRP.defineChatCommand("comms", PlayerAdvertise, 1.5)[/CODE]
Sorry, you need to Log In to post a reply to this thread.