Post: C# Teleport Source
05-23-2014, 11:16 AM #1
moxl
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys!

I want to post Teleport Source, this is not solely made ​​by me (credits to Mango_Knife for Teleport TU and seb5594 for GetServerDetails Source)

I hope it is clear enough ...

    
#region Server Details
// Get Server details Offset
public static uint GetServerdetails = 0x008360d5;

public static uint GetClient(uint client)
{
return 0x0110D60C + (client * 0x3980);
{

public String GetServerDetails(Int32 Index)
{
try
{
return Encoding.ASCII.GetString(PS3.GetBytes(GetServerdetails, 0x100)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
catch (System.IndexOutOfRangeException)
{
return "No Game";
}
}

public String getGameMode()
{
String Game = GetServerDetails(2);
if (Game == "No Game")
{
return "No Game";
}
else
{
return Game;
}
}

public String getMapName()
{
String Map = GetServerDetails(6);
if (Map == "No Game")
{
return "No Game";
}
else
{
return Map;
}
}

public String getHostName()
{
String Host = GetServerDetails(16);
if (Host == "No Game")
{
return "No Game";
}
else
{
return Host;
}
}

public UInt32 ImHost()
{
String Host = getHostName();
UInt32 HostNumber = 999999999;
UInt32 NoGame = 123456789;

if (Host == "No Game")
{
return NoGame;
}
else
{
for (UInt32 i = 0; i < 18; i++)
{
if (PS3.Extension.ReadString(GetClient(i)) == Host)
{
HostNumber = i;
}
}
return HostNumber;
}
}
#endregion


#region Teleport
// Teleport Offset
public static uint TeleportOffset(uint client)
{
return 0x0110A29C + (client * 3980);
}


// Teamcheck
public static uint TeamCheck(uint client)
{
return 0x0110d657 + (client * 3980);
}

public Byte teamcheck(uint client)
{
byte team = PS3.Extension.ReadByte(TeamCheck(client));
return team;
}


#region SavePosition
public void SavePosition(uint client)
{
byte[] position = PS3.Extension.ReadBytes(TeleportOffset(client), 14);
System.IO.File.WriteAllBytes(@"PositionMW3.txt", position);
}
#endregion

#region Teleport Client to Position
public void TeleportClientToPosition(uint client)
{
try
{
byte[] position = System.IO.File.ReadAllBytes(@"PositionMW3.txt");
PS3.Extension.WriteBytes(TeleportOffset(client), position);
}
catch (System.IO.FileNotFoundException)
{
TeleportError();
}
}
#endregion

#region Teleport Client direct
private void TeleportClientDirect(uint client, uint target)
{
byte[] position = PS3.Extension.ReadBytes(TeleportOffset(target), 14);
PS3.Extension.WriteBytes(TeleportOffset(client), position);
}
#endregion

#region Teleport Toggle Frendly to Position
public void TeleportToggleFrendlyToPosition()
{
uint HOST = ImHost();
try
{
for (uint i = 0; i < 18; i++)
{
if (teamcheck(i) == teamcheck(HOST) || i == HOST) // checks whether the player is not in the same team
{
continue;
}
else
{
byte[] position = System.IO.File.ReadAllBytes(@"PositionMW3.txt");
PS3.Extension.WriteBytes(TeleportOffset(i), position);
}
}
}
catch (System.IO.FileNotFoundException)
{
TeleportError();
}
}
#endregion

#region Teleport my Team
private void teleportMyTeam(uint client)
{
for (uint i = 0; i < 18; i++)
{
if (teamcheck(i) != teamcheck(client) || i == client) // checks whether the player is not in the same team
{
continue;
}
else
{
byte[] position = PS3.Extension.ReadBytes(TeleportOffset(client), 14);
PS3.Extension.WriteBytes(TeleportOffset(i), position);
}
}
}
#endregion

#region ERROR
public static void ClientError()
{
string text = "players not selected!";
string error = "Error!";


MessageBox.Show(text, error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}

public static void TeleportError()
{
string text = "First, save position!";
string error = "Error!";

MessageBox.Show(text, error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion
#endregion


// This is only an example of the use of
    
#region Teleport im Funktion
private void TeleportClient()
{
uint HOST = ImHost();
int client = comboBoxClientList.SelectedIndex;

if (radioButton_TeleportToPosition.Checked)
{
TeleportClientToPosition((uint)client);
}
else if (radioButton_TeleportToMe.Checked)
{
TeleportClientDirect((uint)client, HOST);
}
else if (radioButton_TeleportAllHere.Checked)
{
teleportMyTeam((uint)client);
}
else if (radioButton_TeleportMeToClient.Checked)
{
TeleportClientDirect(HOST, (uint)client);
}
}


private void buttonTeleportClient_Click(object sender, EventArgs e)
{
int client = comboBoxClientList.SelectedIndex;

if (client >= 0)
{
TeleportClient();
}
else
{
ClientError();
}
}

private void buttonSavePosition_Click(object sender, EventArgs e)
{
SavePosition(ImHost());
}

private void checkBoxAutoTeleportToPosition_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxAutoTeleportToPosition.Checked)
{
if (System.IO.File.Exists(@"PositionMW3.txt") == true)
{
timerAutoTeleport.Start();
timerAutoTeleport.Interval = 100;
{
TeleportToggleFrendlyToPosition();
timerAutoTeleport.Start();
}
}
else
{
checkBoxAutoTeleportToPosition.Checked = false;
TeleportError();
}

}
else
{
timerAutoTeleport.Stop();
}
}
#endregion
(adsbygoogle = window.adsbygoogle || []).push({});
05-23-2014, 12:00 PM #2
GMTPS3
Do a barrel roll!
I dont understand what you made there :P
Here is my Code feel free to use Smile
     public static class Teleport
{
private static float[] ReadFloatLength(uint Offset, int Length)
{
byte[] buffer = new byte[Length * 4];
PS3.GetMemory(Offset, buffer);
Array.Reverse(buffer);
float[] FArray = new float[Length];
for (int i = 0; i < Length; i++)
{
FArray[i] = BitConverter.ToSingle(buffer, (Length - 1 - i) * 4);
}
return FArray;
}

private static float[] GetOrigin(uint Client)
{
return PS3.ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}

private static void SetOrigin(uint Client, float[] Origin)
{
PS3.WriteFloatArray(0x110a29c + (Client * 0x3980), Origin);
}

public static void TeleportAllTo(uint Client)
{
float[] Origin = GetOrigin(Client);
for (uint i = 0; i < 18; i++)
{
if (Client == i) { }
else
{
SetOrigin(i, Origin);
}
}
}

public static void TeleportCToC(uint Client, uint toClient)
{
float[] Origin = GetOrigin(toClient);
SetOrigin(Client, Origin);
}

public static void TeleporttoSecretRoom(uint Client)
{
/*
if(GetMap() == "mp_dome")
{
SetOrigin(Client,DOMEOrigin);
}
*/
}
}

The following 2 users say thank you to GMTPS3 for this useful post:

moxl, Fatality
05-23-2014, 12:14 PM #3
moxl
Save Point
Danke man!
ich bin da ein relativ neu mit programmieren und so...
ich werde dein Code auf jedem fall mal ausprobieren, es schaut wesentlich ordentliche aus. )))
05-23-2014, 12:32 PM #4
GMTPS3
Do a barrel roll!
Ja man muss versuchen den Code so klein wie möglich zu halten falls du fragen hast zum Programmieren melde dich bei Skype: xCSBK Smile

The following user thanked GMTPS3 for this useful post:

moxl

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo