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
08-13-2014, 05:03 PM #11
-JM-
Space Ninja
Originally posted by Azus View Post
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


Yea well if you want credits you got to share I find something I share
I hate people keeping stuff for them self
08-13-2014, 05:07 PM #12
Azus
Little One
Originally posted by JM
Yea well if you want credits you got to share I find something I share
I hate people keeping stuff for them self


Oh, no I don't care about credit for it or anything. Also, it's not that fact that I was keeping it from people, towards the end of me finishing the function I started going back to school and then I drop off the internet for awhile and let ASC-NGU finish the menu
08-13-2014, 05:10 PM #13
-JM-
Space Ninja
Originally posted by Azus View Post
Oh, no I don't care about credit for it or anything. Also, it's not that fact that I was keeping it from people, towards the end of me finishing the function I started going back to school and then I drop off the internet for awhile and let ASC-NGU finish the menu


sorry I thought you meant i steal it or something my bad
I'm french lol
but basically its maths

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

Azus
08-13-2014, 05:16 PM #14
Azus
Little One
Originally posted by JM
sorry I thought you meant i steal it or something my bad
I'm french lol
but basically its maths


Oh no ahah, and ya math is pretty much all the function is really Snail

The following user thanked Azus for this useful post:

-JM-
08-13-2014, 10:01 PM #15
LOL > You must login or register to view this content.
08-15-2014, 08:53 PM #16
-JM-
Space Ninja
Originally posted by OLDSCHOOLMODZHD View Post
LOL > You must login or register to view this content.


lol it never was new
08-15-2014, 10:11 PM #17
Originally posted by JM
lol it never was new


neither did I :p

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo