1. Post #1
    Kanshi's Avatar
    July 2009
    1,115 Posts
    Hey, tell me if this is wrong section, I wanted to know. Anyways if someone could help me make/edit chat commands for Darkrp, I was trying to make a /me that would be locally displayed around the player like
    ** Joe throws an apple
    and a /event like,
    **A helicopter flys over the building**
    Obviously the event would be server wide, everyone can hear it, and there would be no name infront, admin only command, whereas /me any player can use and is a local event with name of the user displayed. Thanks for taking the time to read, hope someone can help me.

  2. Post #2
    meepy's Avatar
    April 2009
    40 Posts
    http://www.facepunch.com/showthread.php?t=750090
    Examples for chat command setups, don't know if this is helps you or not. You can always go through the DarkRP files to look at examples, start with Chat.lua mabey.

  3. Post #3
    Kanshi's Avatar
    July 2009
    1,115 Posts
    Yea, I looked through the chat.lua , didn't really understand it,
    ChatCommands = {}
    
    function AddChatCommand(cmd, callback, prefixconst)
    	for k,v in pairs(ChatCommands) do 
    		if cmd == v.cmd then return end
    	end
    	table.insert(ChatCommands, { cmd = cmd, callback = callback, prefixconst = prefixconst })
    end
    
    function RP_PlayerChat(ply, text)
    	DB.Log(ply:SteamName().." ("..ply:SteamID().."): "..text )
    	local callback = "" 
    	for k, v in pairs(ChatCommands) do
    		if string.lower(v.cmd) == string.Explode(" ", string.lower(text))[1] then
    			callback = v.callback(ply, string.sub(text, string.len(v.cmd) + 2, string.len(text)))
    			if callback == "" then 
    				return "" 
    			end
    			text = string.sub(text, string.len(v.cmd) + 2, string.len(text)).. " "
    		end
    	end
    	if callback ~= "" then callback = callback.." " end
    	return text, callback
    end
    
    function RP_ActualDoSay(ply, text, callback)
    	callback = callback or ""
    	if text == "" then return "" end
    	local col = team.GetColor(ply:Team())
    	local col2 = Color(255,255,255,255)
    	if not ply:Alive() then
    		col2 = Color(255,200,200,255)
    		col = col2
    	end
    	
    	if GetGlobalInt("alltalk") == 1 then
    		for k,v in pairs(player.GetAll()) do
    			TalkToPerson(v, col, callback..ply:Name(), col2, text, ply)
    		end
    	else
    		TalkToRange(ply, callback..ply:Name(), text, 250)
    	end
    	return "" 
    end
    
    It would help alot if someone can explain this (or tell me if im on the right track?)

  4. Post #4
    Gold Member
    Jamie932's Avatar
    July 2008
    2,582 Posts
    Get ULX for the /me.

  5. Post #5
    I fucking love eggs!!!
    Averice's Avatar
    July 2007
    1,961 Posts
    Get ULX for the /me.
    rated gay. if U don't post this on 10 other threads you will literally become gay IRL in 24 hours. shit got real.


    By orders of rambo_6

  6. Post #6
    Gold Member
    Jamie932's Avatar
    July 2008
    2,582 Posts
    rated gay. if U don't post this on 10 other threads you will literally become gay IRL in 24 hours. shit got real.


    By orders of rambo_6
    I never read this post.