Post: C# Teleporter (like MW2)
07-13-2014, 08:45 PM #1
-JM-
Space Ninja
(adsbygoogle = window.adsbygoogle || []).push({}); Hi Guys I Wanted to share the Teleporter code even if its simple to a lot of people it might be difficult for others keep this in mind
here is the code to spawn the flag Model (I use the flag as an teleporter)
    public static uint flagModel(float[] Origin, float[] Angles, string Model = "prop_flag_neutral")
{
uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
RPC.Call(0x01B6F68, Entity); //SP_script_model
RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
return Entity;
//GMTPS3 code without collisions
}

here is the code to get the teleport working ( monitor it )
    
public static bool flagnum;//to exit thread
public static void Monitorflag(float[] flag, float[] teleportTo)/*here u need to put the position of flag(float[] flag) and where you want it to teleport people(float[] teleportTo)*/
{
flagnum = true;
while (flagnum == true)
{
for (int y = 0; y <= 17; y++)
{
float[] posi = GetOrigin((uint)y);
float gap = distance(posi, flag);
if (gap <= 74.26306/*the distance required to teleport*/)
{
SetOrigin(y, teleportTo);
}
}
}
}
public static float distance(float[] player, float[] Teleporter)//get distance with x y z
{
float X = player[0] - Teleporter[0];
float Y = player[1] - Teleporter[1];
float Z = player[2] - Teleporter[2];
float dis = (float)Math.Sqrt(X * X + Y * Y + Z * Z);//math function to find distance between to points
return dis;

}
public static void SetOrigin(int Client, float[] Origin)//teleports you
{
WriteSingle(0x110a280 + (0x3980 * (uint)Client) + 0x1C, Origin);
}
public static float[] GetOrigin(uint Client)//gets you position
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}


You must thread the function So your program can do other things at the same time
    
Thread str = new Thread(() => Monitorflag(locationflag, teleporter));
str.Start();

Here is a test I Made The bunker is small but its to test the teleporter
You must login or register to view this content.
To connect to your ps3 with the tool put your ip in the cfg (with notepad)

GMTPS3 Big Thanks for releasing solid models


-----------------------------------------------------------------------------------------------------------------

John_dat_goon code to do the same thing
Tho to use this You need the radius witch requires to points X and Y of the flag position and the limit of the teleporter and you get the distance between these 2 points and do πr²
    
public static bool inArea(int Client, float[] Origin, float Radius)
{
int dX = Math.Abs((int)Funcs.GetOrigin(Client)[0] - (int)Origin[0]);
int dY = Math.Abs((int)Funcs.GetOrigin(Client)[1] - (int)Origin[1]);
int sumOfSquares = dX * dX + dY * dY;
int distance = (int) Math.Sqrt(sumOfSquares);

if(Convert.ToInt32(Radius) >= distance)
return true;
return false;
}

-----------------------------------------------------------------------------------------------------------------
For extra help PM me I'll do my best
and if you have feed backs about the thread if something is unclear let me know
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to -JM- for this useful post:

GMTPS3, jwm614, makeabce, Mango_Knife, UnholyTalonTSi, Fatality, zJordanModz
07-13-2014, 11:57 PM #2
Originally posted by JM
Hi Guys I Wanted to share the Teleporter code even if its simple to a lot of people it might be difficult for others keep this in mind
here is the code to spawn the flag Model (I use the flag as an teleporter)
    public static uint flagModel(float[] Origin, float[] Angles, string Model = "prop_flag_neutral")
{
uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
RPC.Call(0x01B6F68, Entity); //SP_script_model
RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
return Entity;
//GMTPS3 code without collisions
}

here is the code to get the teleport working
    
public static bool flagnum;//to exit thread
public static void Monitorflag(float[] flag, float[] teleportTo)
{
flagnum = true;
while (flagnum == true)
{
for (int y = 0; y <= 17; y++)
{
float[] posi = GetOrigin((uint)y);
float gap = distance(posi, flag);
if (gap <= 74.26306/*the distance required to teleport*/)
{
SetOrigin(y, teleportTo);
}
}
}
}
public static float distance(float[] player, float[] Teleporter)
{
float X = player[0] - Teleporter[0];
float Y = player[1] - Teleporter[1];
float Z = player[2] - Teleporter[2];
float dis = (float)Math.Sqrt(X * X + Y * Y + Z * Z);//math function to find distance between to points
return dis;

}
public static void SetOrigin(int Client, float[] Origin)
{
WriteSingle(0x110a280 + (0x3980 * (uint)Client) + 0x1C, Origin);
}
public static float[] GetOrigin(uint Client)
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}


You must thread the function So your program can do other things at the same time
    
Thread str = new Thread(() => Monitorflag(locationflag, teleporter));
str.Start();

Here is a test I Made The bunker is small but its to test the teleporter
You must login or register to view this content.
To connect to your ps3 with the tool put your ip in the cfg (with notepad)

GMTPS3 Big Thanks for releasing solid models

Here's a better way to check if they are near the flag:
    
public static bool inArea(int Client, float[] Origin, float Radius)
{
int dX = Math.Abs((int)Funcs.GetOrigin(Client)[0] - (int)Origin[0]);
int dY = Math.Abs((int)Funcs.GetOrigin(Client)[1] - (int)Origin[1]);
int sumOfSquares = dX * dX + dY * dY;
int distance = (int) Math.Sqrt(sumOfSquares);

if(Convert.ToInt32(Radius) >= distance)
return true;
return false;
}

The following user thanked John for this useful post:

-JM-
07-14-2014, 01:00 AM #3
-JM-
Space Ninja
I'll Add it to The thread Thanks For Sharing Winky Winky
but are functions are almost the same I calculate the Z so if am flying over the teleporter I don't get Teleported
07-14-2014, 09:17 AM #4
GMTPS3
Do a barrel roll!
Nice i made the same Function :P
07-14-2014, 10:04 AM #5
makeabce
I defeated!
Originally posted by JM
Hi Guys I Wanted to share the Teleporter code even if its simple to a lot of people it might be difficult for others keep this in mind
here is the code to spawn the flag Model (I use the flag as an teleporter)
    public static uint flagModel(float[] Origin, float[] Angles, string Model = "prop_flag_neutral")
{
uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
RPC.Call(0x01B6F68, Entity); //SP_script_model
RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
return Entity;
//GMTPS3 code without collisions
}

here is the code to get the teleport working
    
public static bool flagnum;//to exit thread
public static void Monitorflag(float[] flag, float[] teleportTo)
{
flagnum = true;
while (flagnum == true)
{
for (int y = 0; y <= 17; y++)
{
float[] posi = GetOrigin((uint)y);
float gap = distance(posi, flag);
if (gap <= 74.26306/*the distance required to teleport*/)
{
SetOrigin(y, teleportTo);
}
}
}
}
public static float distance(float[] player, float[] Teleporter)
{
float X = player[0] - Teleporter[0];
float Y = player[1] - Teleporter[1];
float Z = player[2] - Teleporter[2];
float dis = (float)Math.Sqrt(X * X + Y * Y + Z * Z);//math function to find distance between to points
return dis;

}
public static void SetOrigin(int Client, float[] Origin)
{
WriteSingle(0x110a280 + (0x3980 * (uint)Client) + 0x1C, Origin);
}
public static float[] GetOrigin(uint Client)
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}


You must thread the function So your program can do other things at the same time
    
Thread str = new Thread(() => Monitorflag(locationflag, teleporter));
str.Start();

Here is a test I Made The bunker is small but its to test the teleporter
You must login or register to view this content.
To connect to your ps3 with the tool put your ip in the cfg (with notepad)

GMTPS3 Big Thanks for releasing solid models


-----------------------------------------------------------------------------------------------------------------

John_dat_goon code to do the same thing
Tho to use this You need the radius witch requires to points X and Y of the flag position and the limit of the teleporter and you get the distance between these 2 points and do πr²
    
public static bool inArea(int Client, float[] Origin, float Radius)
{
int dX = Math.Abs((int)Funcs.GetOrigin(Client)[0] - (int)Origin[0]);
int dY = Math.Abs((int)Funcs.GetOrigin(Client)[1] - (int)Origin[1]);
int sumOfSquares = dX * dX + dY * dY;
int distance = (int) Math.Sqrt(sumOfSquares);

if(Convert.ToInt32(Radius) >= distance)
return true;
return false;
}


MW3 is slowly turning into a mw2...Happy
Thanks! This is really nice
07-14-2014, 02:19 PM #6
-JM-
Space Ninja
Originally posted by makeabce View Post
MW3 is slowly turning into a mw2...Happy
Thanks! This is really nice


Whats left is a zombie mode Like MW2 and hopefully No CFG's

The following user thanked -JM- for this useful post:

John
07-19-2014, 03:28 PM #7
makeabce
I defeated!
Originally posted by JM
Hi Guys I Wanted to share the Teleporter code even if its simple to a lot of people it might be difficult for others keep this in mind
here is the code to spawn the flag Model (I use the flag as an teleporter)
    public static uint flagModel(float[] Origin, float[] Angles, string Model = "prop_flag_neutral")
{
uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
RPC.Call(0x01B6F68, Entity); //SP_script_model
RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
return Entity;
//GMTPS3 code without collisions
}

here is the code to get the teleport working ( monitor it )
    
public static bool flagnum;//to exit thread
public static void Monitorflag(float[] flag, float[] teleportTo)/*here u need to put the position of flag(float[] flag) and where you want it to teleport people(float[] teleportTo)*/
{
flagnum = true;
while (flagnum == true)
{
for (int y = 0; y <= 17; y++)
{
float[] posi = GetOrigin((uint)y);
float gap = distance(posi, flag);
if (gap <= 74.26306/*the distance required to teleport*/)
{
SetOrigin(y, teleportTo);
}
}
}
}
public static float distance(float[] player, float[] Teleporter)//get distance with x y z
{
float X = player[0] - Teleporter[0];
float Y = player[1] - Teleporter[1];
float Z = player[2] - Teleporter[2];
float dis = (float)Math.Sqrt(X * X + Y * Y + Z * Z);//math function to find distance between to points
return dis;

}
public static void SetOrigin(int Client, float[] Origin)//teleports you
{
WriteSingle(0x110a280 + (0x3980 * (uint)Client) + 0x1C, Origin);
}
public static float[] GetOrigin(uint Client)//gets you position
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}


You must thread the function So your program can do other things at the same time
    
Thread str = new Thread(() => Monitorflag(locationflag, teleporter));
str.Start();

Here is a test I Made The bunker is small but its to test the teleporter
You must login or register to view this content.
To connect to your ps3 with the tool put your ip in the cfg (with notepad)

GMTPS3 Big Thanks for releasing solid models


-----------------------------------------------------------------------------------------------------------------

John_dat_goon code to do the same thing
Tho to use this You need the radius witch requires to points X and Y of the flag position and the limit of the teleporter and you get the distance between these 2 points and do πr²
    
public static bool inArea(int Client, float[] Origin, float Radius)
{
int dX = Math.Abs((int)Funcs.GetOrigin(Client)[0] - (int)Origin[0]);
int dY = Math.Abs((int)Funcs.GetOrigin(Client)[1] - (int)Origin[1]);
int sumOfSquares = dX * dX + dY * dY;
int distance = (int) Math.Sqrt(sumOfSquares);

if(Convert.ToInt32(Radius) >= distance)
return true;
return false;
}

-----------------------------------------------------------------------------------------------------------------
For extra help PM me I'll do my best
and if you have feed backs about the thread if something is unclear let me know


Could you add me in skype? maketherocker
07-19-2014, 03:52 PM #8
-JM-
Space Ninja
Originally posted by makeabce View Post
Could you add me in skype? maketherocker


yea sure
08-12-2014, 01:57 PM #9
lukeypukey78
Do a barrel roll!
could you add me on skype lukeypukey78?
08-13-2014, 04:39 PM #10
Azus
Little One
Originally posted by JM
Hi Guys I Wanted to share the Teleporter code even if its simple to a lot of people it might be difficult for others keep this in mind
here is the code to spawn the flag Model (I use the flag as an teleporter)
    public static uint flagModel(float[] Origin, float[] Angles, string Model = "prop_flag_neutral")
{
uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
RPC.Call(0x01B6F68, Entity); //SP_script_model
RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
return Entity;
//GMTPS3 code without collisions
}

here is the code to get the teleport working ( monitor it )
    
public static bool flagnum;//to exit thread
public static void Monitorflag(float[] flag, float[] teleportTo)/*here u need to put the position of flag(float[] flag) and where you want it to teleport people(float[] teleportTo)*/
{
flagnum = true;
while (flagnum == true)
{
for (int y = 0; y <= 17; y++)
{
float[] posi = GetOrigin((uint)y);
float gap = distance(posi, flag);
if (gap <= 74.26306/*the distance required to teleport*/)
{
SetOrigin(y, teleportTo);
}
}
}
}
public static float distance(float[] player, float[] Teleporter)//get distance with x y z
{
float X = player[0] - Teleporter[0];
float Y = player[1] - Teleporter[1];
float Z = player[2] - Teleporter[2];
float dis = (float)Math.Sqrt(X * X + Y * Y + Z * Z);//math function to find distance between to points
return dis;

}
public static void SetOrigin(int Client, float[] Origin)//teleports you
{
WriteSingle(0x110a280 + (0x3980 * (uint)Client) + 0x1C, Origin);
}
public static float[] GetOrigin(uint Client)//gets you position
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}


You must thread the function So your program can do other things at the same time
    
Thread str = new Thread(() => Monitorflag(locationflag, teleporter));
str.Start();

Here is a test I Made The bunker is small but its to test the teleporter
You must login or register to view this content.
To connect to your ps3 with the tool put your ip in the cfg (with notepad)

GMTPS3 Big Thanks for releasing solid models


-----------------------------------------------------------------------------------------------------------------

John_dat_goon code to do the same thing
Tho to use this You need the radius witch requires to points X and Y of the flag position and the limit of the teleporter and you get the distance between these 2 points and do πr²
    
public static bool inArea(int Client, float[] Origin, float Radius)
{
int dX = Math.Abs((int)Funcs.GetOrigin(Client)[0] - (int)Origin[0]);
int dY = Math.Abs((int)Funcs.GetOrigin(Client)[1] - (int)Origin[1]);
int sumOfSquares = dX * dX + dY * dY;
int distance = (int) Math.Sqrt(sumOfSquares);

if(Convert.ToInt32(Radius) >= distance)
return true;
return false;
}

-----------------------------------------------------------------------------------------------------------------
For extra help PM me I'll do my best
and if you have feed backs about the thread if something is unclear let me know
Nice Snail I made something similar to this awhile back, I was going to put it in mine and ASC-NGU's recent menu release but I decided to wait to release it and now look what happened lol

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo