[UCG]Mike Posted August 22, 2014 Share Posted August 22, 2014 hey guys i want to edit my script to be its a local Chat chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","Local") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","Local") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Local)"..nick..": #ffffff"..msg,v,r,g,b,true) end end end addCommandHandler("Local",onChat) Link to comment
./BlackBird# Posted August 22, 2014 Share Posted August 22, 2014 https://community.multitheftauto.com/in ... ls&id=7254 Link to comment
[UCG]Mike Posted August 22, 2014 Author Share Posted August 22, 2014 https://community.multitheftauto.com/index.php?p=resources&s=details&id=7254 its not working Link to comment
Mr_Moose Posted August 22, 2014 Share Posted August 22, 2014 That meme says it all, you need to open the meta.xml and change the settings in there after your own preferences if you want it to work differently than the default configuration. Many servers are running that resource and it works perfect. Link to comment
Saml1er Posted August 24, 2014 Share Posted August 24, 2014 Paste your meta.xml code here. 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