Thread: PM Display
View Single Post
  #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