Search the Community
Showing results for tags 'Position'.
-
Colshape.position return undefined. Is there any ways to get position of colshape clientside. Colshape.getCoords(true/false) also return undefined
-
Hi! I tried to change the player's position and got an error. What am I doing wrong? (api ver. 1.1) Code: [Command("tp")] public void Teleport(Player player, float x, float y, float z) { NAPI.Chat.SendChatMessageToPlayer(player, $"Teleporting to x:{x} y:{y} z:{z}"); player.Position = new Vector3(x, y, z); } Console output result: Exception has been thrown by the target of an invocation. UNHANDLED EXCEPTION IN COMMAND tp FOR RESOURCE MyServer/MyServer System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void GTANetworkAPI.Entity.set_Position(GTANetworkAPI.Vector3)'. at void MyServer.Utils.Teleport(Player player, float x, float y, float z) --- End of inner exception stack trace --- at object RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions) at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) at bool GTANetworkInternals.CommandParser.Parse(Player sender, string cmdRaw, string ourcmd, string[] args)
-
I want to do a job with the Trashmaster and i need the rear position of the car. There should be a marker and u have to throw trash in the vehicle there. I cant find a function that i could use for that. I thought about getting the vehicle rotation and then calculate the position (where the trash should be thrown in). Maybe you guys could help me here with the calculation for that or smth like that. Thank you.
-
- Position
- Trashmaster
-
(and 2 more)
Tagged with:
-
Hello Someone asks me, how to create a car at right side next to player. So i just wrote this little tutorial about. I hope you enjoy this little thing, which was did in two hours, and explained with a horrible english ;D Spend time: 2 hours testing the spawn of vehicles and coding + doc 3 hours making this tutorial with translation 0.5 hours thinking about, why i am doing this ... (i didn't found an answer -.-) First we have to know some things: How is the World working How is the Position working How is the Rotation working How can i spawn a car (Code snippet) How is the World working? => It is a north axis oriented map. If you open the full map ingame, top is north, bottom is south. It is every time a constant and will not change How is the Position working? => It is a Vector based information. It has three types. X => left - | + right Y => top - | + bottom Z => down - | + up The "+" and "-" are the operators here in our coordination system, which we have to use later. How is the Rotation working? => It is a Vector based information. Same here we have three types, but the number is always positive. So we can just use the Z variable. X => back | front (Not tested) Y => left | right (Not tested) Z => ground Then we will get four options: N => 0° E => 270° S => 180° W => 90° We have to use the radius to know how the player is rotated away from north. Just think about your shool days. back then you had geometry and raius was a topic of it. Ok, we got our information. Let us code that stuff Small version Doc version
- 2 replies
-
- 5
-
- CSharp
- Development
-
(and 7 more)
Tagged with: