Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   PM Display (https://forums.graalonline.com/forums/showthread.php?t=134267541)

Gunderak 12-10-2012 01:48 PM

PM Display
 
1 Attachment(s)
Just a simple script to display the PM icon and text of how many PM's you have. Note if the same person sends you a PM it will only display as one from each person, not sure why. Something to do with the way shared.pmswaiting() works.
Anyway here's the script if anyone wants it.
Also upload pm_icon.png to your server.
PHP Code:

//#CLIENTSIDE
function onPM(){ //Invoked when the player receives a PM.
  
onTimeout(); 
}
function 
onTimeout(){
  
temp.pms shared.pmswaiting().size(); //Array of PM's
  
if(pms 0){
    
this.mode = !this.mode//Toggles a boolean to flash PM icon etc.
    
temp.this.mode//this. doesn't work inside with(findimg)...
    
with(findimg(500)){ //Show the PM icon image.
      
image "pm_icon.png";
      
layer 4;
      
alpha = (0);
      
screenwidth 50;
      
10;
    }
    
with(findimg(501)){ //Show the text.
      
text pms;
      
screenwidth 30;
      
5;
      
layer 4;
      
alpha = (0);
    }
    
settimer(0.5);
  }else{
    
//The player has no PM's waiting.
    
hideimgs(500501); //Hide the image and text.
  
}



scriptless 12-10-2012 02:24 PM

Code Gallery?

Gunderak 12-10-2012 03:01 PM

It was sort of a half half, being this isn't really code gallery worthy.

Vlad1 12-11-2012 06:32 AM

although would it be appropriate for servers as it is currently in use in Iera and IClassic so you should probably get snk and xors consent

Gunderak 12-11-2012 09:06 AM

What? O_o
None of what you just said made any sense.
Why would I need anyone's approval?..
It's just a simple script to display PM's, snk or xor don't own the rights of shared.pmswaiting();.

cbk1994 12-11-2012 12:56 PM

Quote:

Originally Posted by Vlad1 (Post 1709224)
although would it be appropriate for servers as it is currently in use in Iera and IClassic so you should probably get snk and xors consent

The iPhone servers do not use the classic PM system. Additionally, this idea is hardly unique on Graal.

Gunderak 12-11-2012 01:53 PM

Quote:

Originally Posted by cbk1994 (Post 1709239)
The iPhone servers do not use the classic PM system. Additionally, this idea is hardly unique on Graal.

This.


All times are GMT +2. The time now is 02:14 PM.

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