Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   question about a script for the PM window(previously named "question") (https://forums.graalonline.com/forums/showthread.php?t=81195)

Frankie 08-13-2008 08:37 AM

question about a script for the PM window(previously named "question")
 
is it possible by script to open up a blank pm window?

a long time ago I was bored, made a custom admin list via gui profiles. I was wondering if I could do something so when you double click one of the staff from the gui window, it opens up a PM window for easier communication to RCs.

I don't know what exactly to search for on the wiki so it's not much help right now. thanks.

Skyld 08-13-2008 09:58 AM

PHP Code:

(@ "-Playerlist").openPMWindow(findplayer("accountname"), false); 

... should open a blank PM window to the account name specified in the findplayer. Clientside only, of course.

cbk1994 08-13-2008 04:09 PM

Quote:

Originally Posted by Skyld (Post 1413844)
PHP Code:

(@ "-Playerlist").openPMWindow(findplayer("accountname"), false); 

... should open a blank PM window to the account name specified in the findplayer. Clientside only, of course.

What does the second parameter do?

Crow 08-13-2008 04:40 PM

Quite a good question. I've been using this for quite some time now, and I still don't know. And I also got a question to this one. The thread fits, so I guess I can ask here. Does anybody know if it's possible to pm people on other playerworlds with this? While they are not being listed on your playerlist?

Demisis_P2P 08-13-2008 04:57 PM

Quote:

Originally Posted by cbk1994 (Post 1413865)
What does the second parameter do?

Set it to true and find out.

I dare you.

Skyld 08-13-2008 06:18 PM

Quote:

Originally Posted by cbk1994 (Post 1413865)
What does the second parameter do?

Defines whether the PM is a mass message.
Quote:

Originally Posted by Crow
Quite a good question. I've been using this for quite some time now, and I still don't know. And I also got a question to this one. The thread fits, so I guess I can ask here. Does anybody know if it's possible to pm people on other playerworlds with this? While they are not being listed on your playerlist?

Well, players from other servers should be listed in allplayers[] on clientside as objects, and this function is expecting a player object. Don't see why it wouldn't work.

Frankie 08-13-2008 06:33 PM

blah, can't get it to work.

PHP Code:

function Admin_TextList1.onDblClick()
{
  
temp.toks params[1].tokenize(":");
  (@ 
"-Playerlist").openPMWindow(findplayer(temp.toks[0]), false);  


temp.toks[0] returns the account in this case. tested that, it works.
also tried changing temp.toks[0] to my account to see if it was a tokenize problem, still couldn't get it.

do you need to be using the scripted or something? I tried it again with the scripted playerlist, still nothing.

Chompy 08-13-2008 06:39 PM

Quote:

Originally Posted by Frankie (Post 1413896)
blah, can't get it to work.

PHP Code:

function Admin_TextList1.onDblClick()
{
  
temp.toks params[1].tokenize(":");
  (@ 
"-Playerlist").openPMWindow(findplayer(temp.toks[0]), false);  


temp.toks[0] returns the account in this case. tested that, it works.
also tried changing temp.toks[0] to my account to see if it was a tokenize problem, still couldn't get it.

do you need to be using the scripted or something? I tried it again with the scripted playerlist, still nothing.

Try get the player object from allplayers[] or players[] ;o (Clientside)

Crow 08-13-2008 06:40 PM

Try it without using findPlayer()? Also, Skyld, if people are not listed in the playerlist (e.g.: they are in your buddylist and you have the option to display all your buddies turned on), they don't seem to appear in allplayers.

Skyld 08-13-2008 06:43 PM

Quote:

Originally Posted by Crow (Post 1413899)
Try it without using findPlayer()? Also, Skyld, if people are not listed in the playerlist (e.g.: they are in your buddylist and you have the option to display all your buddies turned on), they don't seem to appear in allplayers.

Well, they will only be in the allplayers[] array if you can see them in the playerlist because the playerlist is making requests to the serverlister to download buddies/servers/guilds only when they're needed.

Frankie 08-13-2008 06:45 PM

Quote:

Originally Posted by Chompy (Post 1413898)
Try get the player object from allplayers[] or players[] ;o (Clientside)

I don't understand what you mean :[

@ Crow - I tried it, sill nothing.

Skyld 08-13-2008 06:47 PM

Quote:

Originally Posted by Frankie (Post 1413904)
I don't understand what you mean :[

@ Crow - I tried it, sill nothing.

Seems I misinterpreted the playerlist code before, it is always expecting an array:
PHP Code:

(@ "-Playerlist").openPMWindow({findPlayer("Skyld")}, false); 


Frankie 08-13-2008 07:01 PM

I can't get it -.-

PHP Code:

function Admin_TextList1.onDblClick()
{
  
temp.toks params[1].tokenize(":");
  for (
temp.plallplayers)
  {
    if (
pl == temp.toks[0] && pl.headimg == "era_head-remotecontrol.png")
    {
      
this.pmAccount pl;
    }
  }
  (@ 
"-Playerlist").openPMWindow({findPlayer(this.pmAccount)}, false); 


it's supposed to PM the RCs but if you have player and RC open it will try PMing the player.

so I'm using the allplayers so I can get the ID of the RC and not the player, but I can't get it to work right.

PrinceOfKenshin 08-13-2008 07:08 PM

That function is under the clientside of the code right?

Frankie 08-13-2008 07:09 PM

yes.
it works fine when I don't use the allplayers stuff but the thing is, I need to make sure it's pming the RC and not the player.


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

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