//Teleports random vehicle to your player
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
Vehicle randVeh = mapVehicles[0];
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform(DOT)rotation);
veh.transform.position = newPos;
notice (DOT) in the code above. MPGH doesnt like having a period there.
Originally Posted by Lystic
Oh since it seems like a 1-up fest here.
Code:
//Teleports random vehicle to your player
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
Vehicle randVeh = mapVehicles[0];
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform(DOT)rotation);
veh.transform.position = newPos;
notice (DOT) in the code above. MPGH doesnt like having a period there.
Oh how i love you.
What is veh. you forgot a variable.
Originally Posted by blackstab1337
Oh how i love you.
What is veh. you forgot a variable.
I think instead of "veh" he meant "randVeh" :P
Also, a question, how do you include the Steamworks reference in your hack?
Originally Posted by Cabbager001
I think instead of "veh" he meant "randVeh" :P
Also, a question, how do you include the Steamworks reference in your hack?
Just find the dll and add it to your references.
Originally Posted by blackstab1337
Just find the dll and add it to your references.
That's the thing - I should have made it more clear - I don't know where to find the dll
Originally Posted by Cabbager001
That's the thing - I should have made it more clear - I don't know where to find the dll
I did using Steamworks;
Originally Posted by TheMaskedOne
I did using Steamworks;
Ah, I found my error - I had to add a reference to Assembly-CSharp-firstpass.dll
After that, your import was successful
Originally Posted by Lystic
Oh since it seems like a 1-up fest here.
Code:
//Teleports random vehicle to your player
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
Vehicle randVeh = mapVehicles[0];
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform(DOT)rotation);
veh.transform.position = newPos;
notice (DOT) in the code above. MPGH doesnt like having a period there.
You win, gg wp
Originally Posted by Lystic
Oh since it seems like a 1-up fest here.
Code:
//Teleports random vehicle to your player
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
Vehicle randVeh = mapVehicles[0];
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform(DOT)rotation);
veh.transform.position = newPos;
notice (DOT) in the code above. MPGH doesnt like having a period there.
This will just constantly give you the same vehicle, even if its exploded. I tried messing with Vehicles to see if i could get it too return its health but sadly not. Anyway here is the same code but with a Randomizer in it so that you don't get the same exploded vehicle every time.
Code:
if (GUILayout.Button("Teleport Vehicle"))
{
Vehicle[] mapVehicles = UnityEngine.Object.FindObjectsOfType(typeof(Vehicle)) as Vehicle[];
int num = UnityEngine.Random.Range(0, 10);
Vehicle randVeh = mapVehicles[num];
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
randVeh.updatePosition(newPos, Camera.main.transform(DOT)rotation);
randVeh.transform.position = newPos; //CREDITS TO LYSTIC YOU SMEXY BEAST
}
Originally Posted by Blueblood1
This will just constantly give you the same vehicle, even if its exploded. I tried messing with Vehicles to see if i could get it too return its health but sadly not. Anyway here is the same code but with a Randomizer in it so that you don't get the same exploded vehicle every time.
Code:
if (GUI.Button(new Rect(scrWidth-100, 380, 100, 30), "Get Car"))
{
//Credit to Lystic
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
int length = mapVehicles.Length;
int num = UnityEngine.Random.Range(0, length);
Vehicle veh = mapVehicles[num];
veh.tellExploded(false);
veh.tellFuel(100);
veh.tellHealth(100);
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform(dot)rotation);
veh.transform.position = newPos;
}
Of course you could just set the Vehicle stats, but the randomizer still helps.
Code:
if (GUI.Button(new Rect(scrWidth-100, 380, 100, 30), "Get Car"))
{
//Credit to Lystic
Vehicle[] mapVehicles = (Vehicle[])(UnityEngine.Object.FindObjectsOfType(Type.GetTypeFromHandle(Type.GetTypeHandle(new Vehicle()))));
int num = UnityEngine.Random.Range(0, 10);
Vehicle veh = mapVehicles[num];
veh.tellExploded(false);
veh.tellFuel(100);
veh.tellHealth(100);
Vector3 camPos = Camera.main.transform.position;
Vector3 newPos = new Vector3(camPos[0] + 5, camPos[1] + 5, camPos[2]);
veh.updatePosition(newPos, Camera.main.transform****tation);
veh.transform.position = newPos;
}
Also first person to get MP item spawning working first I will suck their dick. I have some code that I've been working on with limited success. (If someone tells me how to reference methods from other classes with RPC successfully I'll have it done for y'all)
Godmode
Code:
public void god()
{
if (godmode)
{
Life[] LifeArray =
UnityEngine.Object.FindObjectsOfType(typeof(Life)) as Life[];
foreach (Life Life in LifeArray)
{
Life.tellWater(100);
Life.tellFood(100);
Life.tellHealth(100);
Life.tellSickness(100);
Life.tellBleeding(false);
Life.tellBones(false);
Sneaky.sneak(0);
Sneaky.sneak(0.1f);
Sneaky.expose(0);
Sneaky.expose(0.1f);
Life.energyBuffer();
}
}
}
Heres One I Found.
Its For Setting Hero/Bandit Ranks.
Hero
Code:
NetworkHandler[] NetArray = UnityEngine.Object.FindObjectsOfType(typeof(NetworkHandler)) as NetworkHandler[];
foreach (NetworkHandler nets in NetArray)
{
nets.setReputation(Network.player, 100);
}
Bandit
Code:
NetworkHandler[] NetArray = UnityEngine.Object.FindObjectsOfType(typeof(NetworkHandler)) as NetworkHandler[];
foreach (NetworkHandler nets in NetArray)
{
nets.setReputation(Network.player, -100);
}
And thus the greatest injection mod of all time was born!
Cant you just inject c# with reflector... why use titanium and such?
Originally Posted by desertflame
Cant you just inject c# with reflector... why use titanium and such?
I thought reflector dlls and titanium injections were different?
Or does reflector work as an injector aswell?..