Jump to content

[help] ID CHAT


Recommended Posts

First, event "onPlayerChat" only has 2 arguments, the message and its type. Second, your function theFormat does nothing. And third, using "id" as the name of the function is confusing, especially when there's a variable with the same name. This could lead to the situations in which you try to use a value without noticing that it's being overriden by another value.

Link to comment

Try this:

function theFormat(player) 
    local ID = getElementData(player, "ID") 
    return ID 
end 
  
function id(text, msgtype) 
    local ids = theFormat(player) 
    local pName = getPlayerName(source) 
if (msgtype == 0) then 
    cancelEvent() 
    outputChatBox("#808080(ID: "..ids..") #FFFFFF"..pName..": #ebddb2"..text, getRootElement(), 255, 255, 255, true) 
end 
end 
addEventHandler("onPlayerChat", root, id) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...