View Single Post
  #4  
Old 06-26-2013, 05:20 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by baseman101 View Post
How would I find the exact player's position in the map part? For example, not the whole gmap, but in that specific level part?
The best solution would be to stick that function into any class joined to the player. Then you can just do...

PHP Code:
temp.pl findPlayer2(this.plAcc);
echo(
temp.pl.getPreciseLevelName()); 
Alternatively if you don't want to mess with the player class, you can do it like this (but it's a bit sloppier, and it's a handy function to have in the player class anyway):

PHP Code:
function onCreated() {
  
temp.pl findPlayer2(this.plAcc);
  echo(
this.getPreciseLevelName(temp.pl));
}

function 
getPreciseLevelName(temp.pl) {
  if (
temp.pl.level.name.ends(".gmap")) {
    return 
temp.pl.level.getmappartfile(temp.pl.xtemp.pl.y);
  }
  
  return 
temp.pl.level.name;

__________________
Reply With Quote