Giter Club home page Giter Club logo

mtasa-lua-types's People

Contributors

dependabot[bot] avatar subtixx avatar toliak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mtasa-lua-types's Issues

โš ๏ธ Some functions return LuaMultiResult instead of Vector3

Describe the bug
Some functions such as getElementPosition, getElementRotation, getElementVelocity and getElementAngularVelocity return Vector3 when used in OOP, however in mtasa-typescript it expects LuaMultiResult<[number, number, number]>.
The same applies to setters, they should expect Vector3 as a parameter.

To Reproduce

let pos = localPlayer.position;
localPlayer.setPosition(pos.x, pos.y, pos.z + 10);
let pos2 = localPlayer.getPosition();
localPlayer.setPosition(pos2.x + 10, pos2.y, pos2.z);

Expected behavior
pos and pos2 should be of type Vector3 and have the x, y, and z properties.

Screenshots
image

NPM Version
7.8.0

NPM Package versions
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

Additional context

let pos = localPlayer.getPosition();
iprint(pos[0], pos[1], pos[2]);

translates into:

local pos = {
    localPlayer:getPosition()
}
iprint(pos[1], pos[2], pos[3])

prints result: vector3: { x = 0.000, y = 0.000, z = 3.117 } nil nil

โญ Update 1.0.0

  • Vector-ized return types and arguments of OOP functions and methods (HARD)
  • Remove deprecated functions

BREAKING: move types/mtasa/* into base directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.