ok, so I'm just working with some stuff and I try to get a pm window open when a player just double clicks another, here's what I got:
PHP Code:
//#CLIENTSIDE
//...script...
function onMouseDown()
{
if ( params[ 0] == "double")
{
this.pID = getPlayerID( mousex, mousey);
if ( this.pID != -1 && this.pID != player.id)
{
players[ this.pID].openexternalpm( false);
}
}
}
function getPlayerID( temp.mx, temp.my)
{
for ( temp.p = 0; p < allplayerscount; p ++)
{
if ( mx in | players[ p].x, players[ p].x + 2| &&
my in | players[ p].y, players[ p].y + 3|)
return players[ p].id;
}
return -1;
}
From what I can tell it should work, but when I double click nothing happens at all. What am I doing wrong?