Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-25-2009, 08:46 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
TServerPlayer.onNickChanges(str, str)

Quote:
TServerPlayer.onNickChanges(str, str) event - nick changes: new and old nick name
I'm having trouble using this...Does anyone know how it works, or if it even works at all?

onPlayerNickChanges(pl) works, but it only passes a player object in the parameters so I would have to keep track of the players old nickname manually. That seems silly to do when there's supposed to be another event that does exactly what I need.
Reply With Quote
  #2  
Old 11-25-2009, 08:50 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
I believe you have to catch the event. I told Chris this but I don't know if he ever relayed the message to you.

Try something like:
PHP Code:
function onCreated() {
  
this.catchEvent(findplayer("salesman"), "onNickChanges""onNickChanged");
}

function 
onNickChanged(plold, new) {
  echo(
pl.account "'s old name: " old " new name: " @ new);

__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 11-25-2009, 08:56 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Tigairius View Post
snip
Yeah we tried that, and I just tried it again...no luck. Unless I'm doing something wrong; does it matter where I put that? Control-NPC?

Edit: I'm wondering if this has something to do with having a custom nickname system on era?
Edit x2: enabled default nicknames and it still didn't work, so scratch that

Last edited by salesman; 11-25-2009 at 09:06 PM..
Reply With Quote
  #4  
Old 11-25-2009, 09:45 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
I tried as well with no luck, both serverside and clientside. I also searched the wiki for onNickChanges, with no results.
There is no mention of it in graal -listscriptfunctions either, but that doesn't list events at all, so no surprises there I guess.

Maybe it just somehow got added into /scripthelp without the event actually being triggered, or maybe it's just not catchable.
Reply With Quote
  #5  
Old 11-25-2009, 10:20 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Maybe it just doesn't work, or maybe it will work in the new version.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 11-26-2009, 10:38 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
I sent a PM to Stefan, so incase anyone was wondering...

Quote:
Originally Posted by Stefan
Ok it was bugged it seems, I've modified it now so it should work with the next npcserver update.
Reply With Quote
  #7  
Old 12-05-2011, 07:34 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
*bump*

Looks like this haven´t been fixed. I also tried the code Tig posted (serverside and clientside)
PHP Code:
function onCreated() {
  
this.catchEvent(findplayer("callimuc"), "onNickChanges""onNickChanged");
}
function 
onNickChanged(ploldnewn) {
  echo(
pl.account "'s old name: " old " new name: " newn);

Any way Stefan is adding it? Seems like he mentioned he will add it into the next npcserver update, but thats also 2 years ago now.
__________________
MEEP!
Reply With Quote
  #8  
Old 12-05-2011, 10:04 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You could do a check like this:

PHP Code:
//#CLIENTSIDE
function ChatBar.onAction() {
  if (
ChatBar.text.starts("setnick")) {
    
temp.new_nickname ChatBar.text.substring("setnick".length());
    
temp.old_nickname player.nick;
  }

__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.