DRW Posted May 17, 2015 Posted May 17, 2015 (edited) local chat_range = 30 addCommandHandler ("local",function(source,_,...) local nick=getPlayerName(source) local msg = table.concat({...}, " ") if getPlayerTeam(source) then r,g,b = getTeamColor(getPlayerTeam(source)) else r,g,b = getPlayerNametagColor(source) end if isPedInVehicle(source)then for _,v in ipairs(getVehicleOccupants(getPedOccupiedVehicle(source)))do outputChatBox("(Car Chat) "..nick..": "..msg,v,r,g,b,true) end else local px,py,pz=getElementPosition(source) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range)then outputChatBox("(Local) ".. nick ..": "..msg,v,r,g,b,true) end end end end) function talk2 () bindKey (source,"u","down", "chatbox local") end --Here is the bindKey addEventHandler ("onPlayerLogin", getRootElement(), talk2) I'm adding a bind to a command so people can open that chatbox, the chatbox works perfectly if I /bind u chatbox local, but the script does nothing. What can I do? Edited May 17, 2015 by Guest
DRW Posted May 17, 2015 Author Posted May 17, 2015 (edited) bindKey (source,"u","down", "chatbox","local") Tried it, still not working EDIT: Sorry, I forgot to log in again, thanks! Edited May 17, 2015 by Guest
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