Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   disable player chat (https://forums.graalonline.com/forums/showthread.php?t=134257199)

sssssssssss 12-05-2009 05:43 AM

disable player chat
 
There has got to be another way besides enablefeatures() to disable player chat. obviously from my most recent thread, it is messing up many, many things on our server. Is there another way to approach this? Anything at all?

p.s.
player.chat == "" doesn't suffice in a timeout. Its not effecient enough and you can almost always still see the regular chat.

Twinny 12-05-2009 05:51 AM

Quote:

Originally Posted by sssssssssss (Post 1542571)
There has got to be another way besides enablefeatures() to disable player chat. obviously from my most recent thread, it is messing up many, many things on our server. Is there another way to approach this? Anything at all?

p.s.
player.chat == "" doesn't suffice in a timeout. Its not effecient enough and you can almost always still see the regular chat.

PHP Code:

//#CLIENTSIDE
function ChatBar.onAction()
{
  
ChatBar.text = "";
} 

:D

sssssssssss 12-05-2009 05:51 AM

Just noticed using onPlayerChats() and a timeout to set player.chat == "" works unless you have the tab chat bar open, then it stays, so somehow I need a way to make that stop too, w/o enablefeatures().

That stops our chat system from working. xD
Any other ways?

cbk1994 12-05-2009 05:51 AM

PHP Code:

//#CLIENTSIDE
function onRemotePlayerChats(pl) {
  
pl.chat = "";
} 

try that

sssssssssss 12-05-2009 06:00 AM

that works for everyones chat but their own. if that makes sense.

cbk1994 12-05-2009 06:04 AM

Quote:

Originally Posted by sssssssssss (Post 1542578)
that works for everyones chat but their own. if that makes sense.

Why would you want to disable the player's own chat? No one else will be able to see it, and it can help with commands or whatever.

sssssssssss 12-05-2009 06:24 AM

It looks really sloppy and annoying to me at least, and i imagine other players as well. We're using bubbles, so its all in the way.

cbk1994 12-05-2009 07:15 AM

Quote:

Originally Posted by sssssssssss (Post 1542589)
It looks really sloppy and annoying to me at least, and i imagine other players as well. We're using bubbles, so its all in the way.

PHP Code:

//#CLIENTSIDE 
function onRemotePlayerChats(pl) { 
  
pl.chat = ""; 
}

function 
ChatBar.onAction() {
  
ChatBar.text = "";
} 

You'll need that in a weapon script, level NPCs don't receive GUI events.

DustyPorViva 12-05-2009 07:20 AM

Can't you just hide chat with enablefeatures?

cbk1994 12-05-2009 07:21 AM

Quote:

Originally Posted by DustyPorViva (Post 1542604)
Can't you just hide chat with enablefeatures?

He said in the OP that it's causing problems with other systems on the server.

sssssssssss 12-05-2009 07:58 AM

PHP Code:

function ChatBar.onAction() {
  
ChatBar.text = "";
} 

hides everything, even the chat bubbles. thats why i was hoping for another way.

fowlplay4 12-05-2009 07:59 AM

Maybe you should look into why enablefeatures is screwing things up.

Most likely cause, multiple scripts calling enablefeatures.

Use a weapon script as your central enabler/disabler.

Here's mine: http://forums.graalonline.com/forums...ad.php?t=87692 but modify it to meet your needs of course.

sssssssssss 12-05-2009 08:00 AM

enablefeatuers is hiding the npc chat, which from what I understand from above posts, is normal. I need that to not happen.

sssssssssss 12-05-2009 08:02 AM

The solution hides everything from the chat tab bar, and that doesn't solve my problem, because it hides everything, so you can't see any chat.

fowlplay4 12-05-2009 08:03 AM

Quote:

Originally Posted by sssssssssss (Post 1542615)
enablefeatuers is hiding the npc chat, which from what I understand from above posts, is normal. I need that to not happen.

Have a weapon script draw whatever is in the npc's chat then, that's your missing half to your custom chat system.

DustyPorViva 12-05-2009 08:04 AM

PHP Code:

function onPlayerChats() {
  
player.storedchat = player.chat;
  
player.chat = "";
} 

Use player.storedchat to render the chat bubble for only the player(not other players). The only problem is this might interfere with chat commands... but I dunno. It may process commands before it clears it.

sssssssssss 12-05-2009 08:06 AM

Thanks, I just didnt know what else to do, and didnt know where to look on wiki. appreciate it everyone. alot. :)

sssssssssss 12-05-2009 08:43 AM

On a similiar note, trying to disable s+a, and oddly, enablefeatures isnt working for it. I dont know whats up with enablefeatures causing so many issues...

Regardless, i was trying to get this to work, and will post this code, that I know will not work.

PHP Code:

function onKeyPressed(keystring)
{
  if (
keystring == "s" && keystring == "a") { 
    
setAni("armageddon-idle", NULL);
  }
} 

Is there another way to interrupt the s+a besides enable features? Been trying for hours. Didnt see anything about it except enablefeatures on the forums.

p.s, tried to get the keycode for s+a, apparently you cant, at least from using

PHP Code:

function onKeyPressed( keycode, keystring, scancode ) {
  if (
this.keydebug)
  
player.chat = params;
  else
  
player.chat = "";
} 



All times are GMT +2. The time now is 09:37 PM.

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