Quote:
Originally Posted by Emera
I don't know if this is a bug or if I'm doing this wrong, but it worked a few weeks ago using this method and it's not working now. I'm basically trying to "summon" a player by sending my level, x and y to the serverside, then warping the player to the said co-ordinates. For some reason, if I'm on a gmap, it will warp the player far to the right of my co-ordinates.
This is the summon trigger.
PHP Code:
case "summon":
with(findplayer(params[1])) {
temp.slevel = params[2];
temp.sx = params[3];
temp.sy = params[4];
player.setlevel2(temp.slevel,temp.sx,temp.sy);
}
break;
and this is what I'm sending to the server.
PHP Code:
triggerserver("gui",name,"summon",wc_TextList1.selected.text,player.level,player.x,player.y);
wc_TextList1.selected.text being a players account name.
Any ideas?
|
It's because clientside player.level is the singular level, whereas serverside player.level would be the map object, while player.x and player.y is relevant to your map coordinates.
You don't really need to be passing level and coordinates for a basic summon though, you could just do:
PHP Code:
case "summon":
temp.pl = findplayer(params[1]);
if(temp.pl == NULL){
return;
}
temp.pl.setlevel2(player.level.name, player.x, player.y);
break;