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.m = this.mode; //this. doesn't work inside with(findimg)...
with(findimg(500)){ //Show the PM icon image.
image = "pm_icon.png";
layer = 4;
alpha = (m ? 1 : 0);
x = screenwidth - 50;
y = 10;
}
with(findimg(501)){ //Show the text.
text = pms;
x = screenwidth - 30;
y = 5;
layer = 4;
alpha = (m ? 1 : 0);
}
settimer(0.5);
}else{
//The player has no PM's waiting.
hideimgs(500, 501); //Hide the image and text.
}
}