Jump to content

onClientChangeNick


izstas

Recommended Posts

Well, I suppose the source would be the player that changed his nick, so I guess it would be like

  
function nickChange ( source ) 
              outputChatBox( "Your old nick was better", source, 255, 255, 255 ) 
end 
addEventhandler("onClientChangeNick", getRootElement(), nickChange ) 
  

but I'm just guessing here, but since most of the events are like that i guess that's how it works :P

maybe there are parameters like newnick and oldnick, but I don't know, maybe a dev can answer that.

Link to comment

Parameters for functions are:

- oldnick

- newnick

and source returned is the player who changed his nick.

This is not a function! This is an Event! The way function works is different to the way event works. Function gets attached to event.

Link to comment
Parameters for functions are:

- oldnick

- newnick

and source returned is the player who changed his nick.

This is not a function! This is an Event! The way function works is different to the way event works. Function gets attached to event.

With onClientChangeNick(source, oldnick, newnick), I wanted to show which parameters are used by "onClientChangeNick" event. I didn't say you should call function onClientChangeNick ;)

Link to comment

Does this event even work? I tried everything I could think of, but I couldn't get it to work..

here's my code

  
function nickChange ( source, oldnick, newnick ) 
     outputChatBox( "You have succesfuly changed your nick from" .. oldnick .. " to " .. newnick .. "!", source, 255, 255, 255 ) 
end 
  
addEventHandler("onClientChangeNick", getRootElement(), nickChange ) 
  

Link to comment

Has anyone got this working ? I've tried everything but I can't make this nick change event fire e.g. no text from this is ever displayed :

  
function nickChange(oldnick,newnick) 
    outputDebugString("NICK CHANGE!") 
end 
  
addEventHandler("onClientChangeNick", getRootElement(), nickChange ) 
  

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...