Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   PMs, Masses, and Staff PMs (https://forums.graalonline.com/forums/showthread.php?t=77925)

Switch 12-14-2007 03:19 AM

PMs, Masses, and Staff PMs
 
How would I be able to scrip stuff like this? As in, being able to tell if the person has recieved one.
Is there like havemass, havepms, have staffmsgs... what's the flag?

BTW, inspiration from Crow ;)

Googi 12-14-2007 10:23 PM

For staff messages:

PHP Code:

//#CLIENTSIDE
function onWhatever() {
  for (
plallplayers) {
    if (
pl.pmswaiting()) {
      
//check if pl.account is wearing a staff tag
    
}
  }



gemini2 12-14-2007 10:32 PM

PHP Code:

temp.findplayer("gemini2");
if (
p.pmswaiting()) {
  if (
p.isguildpm()) {
    
// GUILD PM
  
}else if (p.ismasspm()) {
    
// MASS PM
  
}
  
// etc.







Quote:

Originally Posted by Googi (Post 1363800)
For staff messages:

PHP Code:

//#CLIENTSIDE
function onWhatever() {
  for (
plallplayers) {
    if (
pl.pmswaiting()) {
      
//check if pl.account is wearing a staff tag
    
}
  }



From what I see, that will check every players on the server if they have a pm on wait :O

Switch 12-14-2007 10:40 PM

thanks. Now, how would I be able to check who sent the PM?
And yes Crow, I'm trying to finish that system you made. I like it :i

Googi 12-14-2007 10:42 PM

Quote:

Originally Posted by gemini2 (Post 1363804)
From what I see, that will check every players on the server if they have a pm on wait :O

I assumed that was the idea. Of course you can just use findplayer if you know specifically who you want to check.

EDIT: I think I may have misread your statement. Were you asking if it checks every player to see if they have PMs waiting or checks to see if there are PMs waiting from each player? I think (since this is clientside) it checks to see if there are PMs waiting from each player.

Quote:

Originally Posted by Switch (Post 1363805)
thanks. Now, how would I be able to check who sent the PM?

In this context isn't var.account the account of the person who sent the pm? I'm pretty sure Stefan said that it was...

cbk1994 12-14-2007 11:11 PM

Quote:

Originally Posted by Googi (Post 1363807)
I assumed that was the idea. Of course you can just use findplayer if you know specifically who you want to check.

EDIT: I think I may have misread your statement. Were you asking if it checks every player to see if they have PMs waiting or checks to see if there are PMs waiting from each player? I think (since this is clientside) it checks to see if there are PMs waiting from each player.



In this context isn't var.account the account of the person who sent the pm? I'm pretty sure Stefan said that it was...

What do you mean by var.account?

PHP Code:

for ( temp.allplayers )
{
  if ( 
temp.a.PMsWaiting() )
  {
    
// Gah
  
}


Would not something like that work?

Switch 12-14-2007 11:22 PM

I want to make it so the person RECIEVING the PM knows who sent it. Already have the Message system worked so it can display in bottom left. I need to know how to find the person who sent it and be able to see who did on the reciever's screen.

Googi 12-14-2007 11:41 PM

Quote:

Originally Posted by cbkbud (Post 1363817)
What do you mean by var.account?

p.account, pl.account, etc.

Switch 12-15-2007 06:09 PM

Ok now can someone help with this:

PHP Code:

//#CLIENTSIDE
function onCreated()
  
onTimeOut();
  
function 
onTimeOut() {
  
player.chat player.account.pmswaiting() @ " has sent you a PM";
  
setTimer(.05);


Can someone tell me how to make it so FIRST it checks if the player has a message, THEN it checks if it's a Guild Message, Staff Message, PM, or Mass. It's confuszling me.

gemini2 12-15-2007 06:37 PM

Quote:

Originally Posted by Switch (Post 1363948)
Ok now can someone help with this:

PHP Code:

//#CLIENTSIDE
function onCreated()
  
onTimeOut();
  
function 
onTimeOut() {
  
player.chat player.account.pmswaiting() @ " has sent you a PM";
  
setTimer(.05);


Can someone tell me how to make it so FIRST it checks if the player has a message, THEN it checks if it's a Guild Message, Staff Message, PM, or Mass. It's confuszling me.

PHP Code:

function onCreated()
  
setTimer(0.05);

function 
onTimeout() {
  if (
player.pmswaiting()) {
    if (
player.isguildpm()) {
      
// GUILD PM
    
}else if (player.ismasspm()) {
      
// MASS PM
    

  }
  
setTimer(0.1);



Switch 12-15-2007 07:02 PM

PHP Code:

//#CLIENTSIDE
function onCreated()
  
setTimer(.05);
  
function 
onTimeOut() {
  if (
player.ismasspm()) {
    
player.chat "1";
  }
  
setTimer(.05);


Won't make you say "1"...

gemini2 12-15-2007 07:13 PM

Quote:

Originally Posted by Switch (Post 1363966)
PHP Code:

//#CLIENTSIDE
function onCreated()
  
setTimer(.05);
  
function 
onTimeOut() {
  if (
player.ismasspm()) {
    
player.chat "1";
  }
  
setTimer(.05);


Won't make you say "1"...

there, fixed it in the quote, PS: player.ismasspm()

Edit: Well, oddly it doesn't seem to work.. :(
they are listed @ http://wiki.graal.net/index.php/Crea...side_Functions

PHP Code:


TServerPlayer

  isguildpm
() - returns boolean
  ismasspm
() - returns boolean
  openexternalhistory
() - returns boolean
  openexternalpm
(bool) - returns boolean
  pmswaiting
() - returns boolean
  showprofile
() 


Switch 12-15-2007 07:29 PM

It was already like that, I just pasted it wrong at first. But it still won't work.


All times are GMT +2. The time now is 07:47 PM.

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