View Issue Details

IDProjectCategoryView StatusLast Update
0002565Multi Theft Auto : San AndreasScriptingpublic2007-09-28 16:08
ReporterLucif3rAssigned ToJax 
Status resolvedResolutionfixed 
Product Versionblue_sa.r2.a12 
Target VersionFixed in Versionmtasadm_v1.0-dp1 
Summary0002565: stopObject() doesnt really stop the moving object.

As title says, stopObject doesnt really stop the moving object.
The visuall object do indeed stop moving, but the coords are still changing untill it has reached its destination.

This bug prevents us/me from stopping an objects movement, and then resume it later on.

This is the code i use (well, part of it...):

function testTheFlag ( source )
local x, y, z = getElementPosition(source)
flag = createObject ( 11245, x + 4.5, y, z + 8, 0, 290, 0 )
lowerFlag = createColCircle ( x +4, y, z, 2 )
addEventHandler ("onColShapeHit", lowerFlag, lowerTheFlag)
addEventHandler ("onColShapeLeave", lowerFlag, stopTheFlag)
addCommandHandler ("flag", testTheFlag)

function lowerTheFlag ( source )
local x1, y1, z1 = getElementPosition(flag)
local z2 = z1 -14
setTimer (pos, 1000, 10, source )
moveObject ( flag, 10000, x + 0.5, y, z2 )
function pos ( source )
local x1, y1, z1 = getElementPosition(flag)
outputChatBox (""..z1.."")
function stopTheFlag ( source )
stopObject ( flag )

so as u can see from the script, the flag is ment to lower when u enter the colshape, and stop when u leave it.
The timer which calls the "pos" function outouts the flag's Z-coord ones a sec.
The Z-coord keeps lowering itself even if ure not in the colshape.

Btw, for a better testscript, look at BFTEST on tweaks FTP.

edit: since im such a nice guy, i recorded a video for you.
You can clearly see that the z-coord keeps changing, alltho the flag has stopped.
You can also see the flag instantly moving to the "real" position when i reenter the colshape, instead of continue to move down nice and smooth.


edit2: this is a SERVER script

TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change