Skip to content

Conversation

fresholia
Copy link
Contributor

@fresholia fresholia commented Jan 18, 2021

Fixes #874
Added 2 events 1 functions:

bool isObjectMoving(object)
event onClientObjectMoveStart
event onClientObjectMoveStop

Code on lua:

local obj = createObject(5239, -2417.22339, -606.70374, 132.56250)
moveObject(obj, 3000, -2417.22339, -606.70374, 137.56250)

addEventHandler("onClientObjectMoveStart", obj,
    function()

    end
)

addEventHandler("onClientObjectMoveStop", obj,
    function()
        outputChatBox("done")
    end
)
setTimer(
    function()
        outputChatBox(tostring(isObjectMoving(obj)))
    end,
500, 0)

@StrixG StrixG added the enhancement New feature or request label Jan 18, 2021
@fresholia fresholia changed the title Add onClientObjectMove, onClientObjectMoveFinish event, add isObjectM… Add onClientObjectMoveStart, onClientObjectMoveStop, isObjectMove Jan 18, 2021
@fresholia fresholia requested a review from botder January 18, 2021 15:59
Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing, single-line ifs like this:

if (true)
    foo.DoSomething();

Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left you one thing to deal with.

@fresholia fresholia requested a review from Lpsd January 19, 2021 09:56
@Lpsd Lpsd changed the title Add onClientObjectMoveStart, onClientObjectMoveStop, isObjectMove Add onClientObjectMoveStart, onClientObjectMoveStop, isObjectMoving Jan 19, 2021
Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, just fix that extra newline and we're good.

@fresholia fresholia requested a review from Lpsd January 20, 2021 20:47
@Lpsd Lpsd merged commit 0834853 into multitheftauto:master Jan 20, 2021
@patrikjuvonen
Copy link
Contributor

patrikjuvonen commented Jan 21, 2021

@cleopatradev Please create new Wiki pages for these events and the function, thank you.
https://wiki.multitheftauto.com/wiki/Main_Page

@patrikjuvonen patrikjuvonen added this to the Next Release milestone Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isObjectMoving(), onObjectMoved
5 participants