I have tried this several ways, it does not appear to be working.
I even pulled the specific code out of the uMod project and pasted it directly. No dice.
It's compiling fine on the server.
My character doesn't move at all when I call.
When I ran a test on the actual retrieved "entity" it was returning null. Yet, somehow IPlayer.Position works every time and pulls it's data from entity. Not sure how that's even possible.
This is what I'm trying right now --
entity returns null every time. Note I only pulled this in because Teleport was failing. It's exactly the code in Teleport.
The xyz message works every time, but yet it gets it's info from "IPlayer.Position", which calls exactly the same entity.
I even pulled the specific code out of the uMod project and pasted it directly. No dice.
It's compiling fine on the server.
My character doesn't move at all when I call.
When I ran a test on the actual retrieved "entity" it was returning null. Yet, somehow IPlayer.Position works every time and pulls it's data from entity. Not sure how that's even possible.
This is what I'm trying right now --
if ( msg == "recover" ) // TODO: Implement this
{
// time played at time of death, minus time played thus-far in this game. (not time today, not since logged in)
// if 10 minutes has passed, sorry no teleport.
// above not implemented.
// if xyz is 0,0,0 .. sorry no teleport.
// {"RecoverFail", "Recovery command failed, the point of death was unknown!" },
float x, y, z;
EntityPlayer entity = Object as EntityPlayer;
// hard code for testing...
x = -98.01f; y = 74.25f; z = 2008.01f; // west 98, 60+14.1 up (I add a little extra), north 2008
entity?.SetPosition(new Vector3(x, y, z));
if (entity == null)
{
NextFrame( () => ci.IPlayer.Message( "Entity is null...." ) );
}
ci.IPlayer.Position( out x, out y, out z );
NextFrame( () => ci.IPlayer.Message( "xyz {0}, {1}, {2}", "", x, y, z ) );
}
entity returns null every time. Note I only pulled this in because Teleport was failing. It's exactly the code in Teleport.
The xyz message works every time, but yet it gets it's info from "IPlayer.Position", which calls exactly the same entity.