Antoni Posted April 13, 2013 Share Posted April 13, 2013 How would you write a /me command, /do command, and an onPlayerText function that only lets people nearby hear you. Link to comment
Renkon Posted April 13, 2013 Share Posted April 13, 2013 use: Colshapes outputChatBox cancel onPlayerChat mode ME. and u need colShape to get the players that are around the player who makes it. An example can be found in: onPlayerChat wiki page Link to comment
Antoni Posted April 13, 2013 Author Share Posted April 13, 2013 Oh... I'm new to scripting I don't quite understand... Link to comment
Castillo Posted April 14, 2013 Share Posted April 14, 2013 You may want to check out this topic: viewtopic.php?f=148&t=40809 Link to comment
codeluaeveryday Posted April 14, 2013 Share Posted April 14, 2013 I am unsure of the /do command as I'm sure its an RP command, but I can help you with the /me command locally, I made this small script for my K@N Zombies server some time ago: You may also use the function again: function outputNearElement(message, element, red, green, blue, bool, chatRadius) local posX, posY, posZ = getElementPosition(element) local chatSphere = createColSphere(posX, posY, posZ, chatRadius) local nearbyPlayers = getElementsWithinColShape(chatSphere, "player") destroyElement(chatSphere) for i, v in ipairs(nearbyPlayers) do outputChatBox(message, v, red, green, blue, bool) end end addEventHandler('onPlayerChat', getRootElement(), function(message, mType) if mType == 1 then cancelEvent() outputNearElement('* '..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')..' '..message, source, 255, 0, 255, true, 30) end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now