Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-10-2012, 01:48 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
PM Display

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.
  
}

Attached Images
 
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
 


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 05:40 AM.


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