Quote:
Originally Posted by ffcmike
Is there a function for determining a gmap from a specified .nw file parameter?
|
Would be nice if there was a function for this (can't seem to find one through /scripthelp in RC or the wiki) so I don't have to do stuff like:
PHP Code:
public function getGMAP(temp.lvl){
temp.x = getmapx(temp.lvl) * 64;
temp.y = getmapy(temp.lvl) * 64;
for(temp.i : serveroptions.gmaps){
temp.obj = findlevel(temp.i @ ".gmap");
if(temp.obj.getmappartfile(temp.x, temp.y) == temp.lvl){
return {temp.obj, temp.x, temp.y};
}
}
return NULL;
}
PHP Code:
temp.obj = findlevel(temp.lvlname);
if(temp.obj == NULL){
if(levelexists(temp.lvlname)){
temp.l = controlnpc.getGMAP(temp.lvlname);
return {temp.l[0], temp.l[1] + temp.x, temp.l[2] + temp.y};
}
}