Page 1 of 1

teleport anoying problem

PostPosted: Fri Jun 26, 2015 2:00 am
by lion228
how do i make it teleport two times, when i teleport once it teleports me to a blank zone 0
then it removeobject =player, when i teleport command again it gose correct zone like in pictures
the code is bellow but what code do i add to make it teleport twice with a waiting period till it shows the removeobject on console screen then teleport 2nd time ?




static public List<GmCommandHandler> BaseCommand = new List<GmCommandHandler>()
{
new GmCommandHandler("info",Info, null, 1, 0, "Info of selected target"),
new GmCommandHandler("invinsible",Invinsible, null, 1, 0, "Set target invinsible"),
new GmCommandHandler("save",Save, null, 1, 0, "Save target"),
new GmCommandHandler("gps",Gps, null, 1, 0, "Print your position"),
new GmCommandHandler("kill",Kill, null, 1, 0, "Kill target"),
new GmCommandHandler("revive",Revive, null, 1, 0, "Rez target Unit"),
new GmCommandHandler("teleport",null, TeleportCommands, 1, 0, "Teleport commands"),
new GmCommandHandler("gmmode",GmMode, null, 1, 0, "Set Invisible / Invinsible"),




Code: Select all
#region Teleport static public bool TeleportMap(Player Plr, ref List<string> Values) { int ZoneID = GetInt(ref Values); int WorldX = GetInt(ref Values); int WorldY = GetInt(ref Values); int WorldZ = GetInt(ref Values); Plr.Teleport((UInt16)ZoneID, (uint)WorldX, (uint)WorldY, (UInt16)WorldZ, 0); GMCommandLog Log = new GMCommandLog(); Log.PlayerName = Plr.Name; Log.AccountId = (uint)Plr.Client._Account.AccountId; Log.Command = "TELEPORT TO " + ZoneID + " " + WorldX + " " + WorldY; Log.Date = DateTime.Now; WorldMgr.Database.AddObject(Log); return true; } static public bool TeleportAppear(Player Plr, ref List<string> Values) { string PlayerName = GetString(ref Values); Player Target = Player.GetPlayer(PlayerName); if (Target == null) { Plr.SendMessage(0, "Server", "Player not found :" + PlayerName, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT); return false; } if (Target.Zone == null) return false; Plr.Teleport(Target.Zone, (uint)Target.WorldPosition.X, (uint)Target.WorldPosition.Y, (UInt16)Target.WorldPosition.Z, 0); GMCommandLog Log = new GMCommandLog(); Log.PlayerName = Plr.Name; Log.AccountId = (uint)Plr.Client._Account.AccountId; Log.Command = "APPEAR PLAYER " + Target.Name + " TO " + Target.Zone.ZoneId + " " + Target._Value.WorldX + " " + Target._Value.WorldY; Log.Date = DateTime.Now; WorldMgr.Database.AddObject(Log); return true; } static public bool TeleportSummon(Player Plr, ref List<string> Values) { string PlayerName = GetString(ref Values); Player Target = Player.GetPlayer(PlayerName); if (Target == null) { Plr.SendMessage(0, "Server", "Player not found :" + PlayerName, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT); return false; } Target.Teleport(Plr.Zone, (uint)Plr.WorldPosition.X, (uint)Plr.WorldPosition.Y, (UInt16)Plr.WorldPosition.Z, 0); GMCommandLog Log = new GMCommandLog(); Log.PlayerName = Plr.Name; Log.AccountId = (uint)Plr.Client._Account.AccountId; Log.Command = "SUMMON PLAYER " + Target.Name + " TO " + Plr.Zone.ZoneId + " " + Plr._Value.WorldX + " " + Plr._Value.WorldY; Log.Date = DateTime.Now; WorldMgr.Database.AddObject(Log); return true;
48e5e670baafbf026ab57fa1e9d76040.png
console teleport output
48e5e670baafbf026ab57fa1e9d76040.png (12.54 KiB) Viewed 3793 times
f516270a337991590c6a8779f807f3b6.png
zone 0
f516270a337991590c6a8779f807f3b6.png (52.3 KiB) Viewed 3793 times

Re: teleport anoying problem

PostPosted: Thu Jul 02, 2015 10:48 pm
by Graveen
i guess Target.teleport().

Re: teleport anoying problem

PostPosted: Fri Jul 03, 2015 11:17 am
by lion228
i added it 2 times but its just teleporting once


static public bool TeleportSummon(Player Plr, ref List<string> Values)
{
string PlayerName = GetString(ref Values);

Player Target = Player.GetPlayer(PlayerName);

if (Target == null)
{
Plr.SendMessage(0, "Server", "Player not found :" + PlayerName, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);
return false;
}

Target.Teleport(Plr.Zone, (uint)Plr.WorldPosition.X, (uint)Plr.WorldPosition.Y, (UInt16)Plr.WorldPosition.Z, 0);



Target.Teleport(Plr.Zone, (uint)Plr.WorldPosition.X, (uint)Plr.WorldPosition.Y, (UInt16)Plr.WorldPosition.Z, 0);

GMCommandLog Log = new GMCommandLog();
Log.PlayerName = Plr.Name;
Log.AccountId = (uint)Plr.Client._Account.AccountId;
Log.Command = "SUMMON PLAYER " + Target.Name + " TO " + Plr.Zone.ZoneId + " " + Plr._Value.WorldX + " " + Plr._Value.WorldY;
Log.Date = DateTime.Now;
WorldMgr.Database.AddObject(Log);

return true;
}

Re: teleport anoying problem

PostPosted: Sat Jul 04, 2015 12:16 pm
by Argo
this doesn't look like daoc. what is it?

Re: teleport anoying problem

PostPosted: Sat Jul 04, 2015 3:15 pm
by lion228
i know thats why i was told to put it in here what code i put to make it teleport 2 times ?

Re: teleport anoying problem

PostPosted: Sun Jul 05, 2015 8:58 am
by Graveen
You can't teleport to the same location : it 'll have no effect. You msut change the parameters of target.Teleport()

Basically 2 consecutives teleports are useless: you can only notice them if you have a loading screen between zones.

Re: teleport anoying problem

PostPosted: Sun Jul 05, 2015 3:24 pm
by lion228
do you have a example ? not sure what you meain with You msut change the parameters of target.Teleport()

Re: teleport anoying problem

PostPosted: Sun Jul 05, 2015 7:25 pm
by Graveen
Plr.Zone, (uint)Plr.WorldPosition.X, (uint)Plr.WorldPosition.Y, (UInt16)Plr.WorldPosition.Z

Plr.Zone = zone id
Plr.WorldPosition.X = X coord in this zone
also for Y and Z

So to port to a defined position, ie Zone 2, X 1000 Y 2000 Z 500:
Target.Teleport(2, 1000, 2000, 500, 0);

Re: teleport anoying problem

PostPosted: Tue Jul 07, 2015 5:53 am
by lion228
thanks for helping but wont that need to be changed and then build each time i want to teleport to diffrent area ? it dose use a table for zone taxis .the problem is i click on a flight master npc and it opens a map then i click on a zone in the map i want to go to then it suppost to fly me there on first go it dont and gose to zone0 then i have to use a gm teleport command in the chat box to teleport to the place i selected this is the error im trying to understand and fix

Re: teleport anoying problem

PostPosted: Tue Jul 28, 2015 3:12 pm
by lion228
bump