• Darkrp Custom Chat command - Comms
    5 replies, posted
I'm trying to make a custom chat command /comms for my server, when someone types /comms it shows up like this: "[Advert] Captainship14:(Green text)hello world" Im trying to get it to look like this: "[Comms] Captainship14:(Green text)hello world" So my problem is idk how to make the prefix of the command(/comms) to show up as comms instead of advert. [IMG]https://s32.postimg.org/6njseezp1/Capture.png[/IMG]
Copy PlayerAdvertise and change its name to PlayerComms And then at the end of PlayerComms there's DarkRP.getPhrase("advert") Change it to "[Comms]"
Unrelated but are you making Garry's Station 13?
i am trying to do the same thing but no matter what i do it still shows up as advert
[QUOTE=Aarone2004;50687369]Copy PlayerAdvertise and change its name to PlayerComms And then at the end of PlayerComms there's DarkRP.getPhrase("advert") Change it to "[Comms]"[/QUOTE] ok so I changed the coding but it still isn't working and now its showing up with the players steam name then /comms "what they typed" ex: ImDazed: /comms testing [CODE]local function PlayerComms(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, 224, 143, 255), text, ply) end end return args, DoSay end DarkRP.defineChatCommand("comms", PlayerComms, 1.5) [/CODE] I do have a sh_ declarechatcommand also [CODE]DarkRP.declareChatCommand{ command = "comms", description = "Advertise something to everyone in the server.", delay = 1.5 } [/CODE]
where do i add this
Sorry, you need to Log In to post a reply to this thread.