Fabio(GNR) Posted April 10, 2012 Share Posted April 10, 2012 I have tried in two scripts, one with firing a projectile which succesfully retrieved material id but not worldModelID. Also in this script: addCommandHandler("removeObject", function (playerSource) showCursor(true) addEventHandler("onClientClick", getRootElement(), clickRemoveObject) end ) function clickRemoveObject(button, state, x, y) local cx,cy,cz = getCameraMatrix() wx, wy, wz = getWorldFromScreenPosition(x,y, 1000) hit, hX, hY, hZ, hitEl, nX, nY, nZ, mat, light, piece, ModelID, ModelPosX, ModelPosY, ModelPosZ = processLineOfSight(cx,cy,cz,wx,wy,wz, true, false ,false, false, true, true, true, true, nil, true ) removeWorldModel ( ModelID, 50, ModelPosX, ModelPosY, ModelPosZ ) setCameraMatrix( ModelPosX, ModelPosY, ModelPosZ + 500 ) setTimer(setCameraTarget, 100, 1, localPlayer) end worldModelID = nil, and the ModelPos too. Link to comment
Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 try this: addCommandHandler("removeObject",function() showCursor(true) addEventHandler("onClientClick", root, clickRemoveObject) end) function clickRemoveObject(button, state, x, y) local cx,cy,cz = getCameraMatrix() wx, wy, wz = getWorldFromScreenPosition(x,y, 1000) hit, hX, hY, hZ, hitEl, nX, nY, nZ, mat, light, piece, ModelID, ModelPosX, ModelPosY, ModelPosZ = processLineOfSight(cx,cy,cz,wx,wy,wz, true, false ,false, false, true, true, true, true, nil, true ) removeWorldModel ( ModelID, 50, ModelPosX, ModelPosY, ModelPosZ ) setCameraMatrix( ModelPosX, ModelPosY, ModelPosZ + 500 ) setTimer(setCameraTarget, 100, 1,localPlayer) end Link to comment
Fabio(GNR) Posted April 10, 2012 Author Share Posted April 10, 2012 Didn't see anything change but, didn't work. Link to comment
Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 Didn't see anything change but, didn't work. try this now: addCommandHandler("removeObject",function() showCursor(true) addEventHandler("onClientClick", root, clickRemoveObject) end) function clickRemoveObject(button, state, x, y) local cx,cy,cz = getCameraMatrix() wx, wy, wz = getWorldFromScreenPosition(x,y, 1000) hit,hitX, hitY, hitZ,hitElement,normalX, normalY, normalZ,material,lighting,piece,worldModelID,wpX,wpY,wpZ,wrX,wrY,wrZ = processLineOfSight(cx,cy,cz,wx,wy,wz, true, false ,false, false, true, true, true, true, nil, true ) removeWorldModel ( worldModelID, 50, wpX, wpY, wpZ ) setCameraMatrix( wpX, wpY, wpZ + 500 ) setTimer(setCameraTarget, 100, 1,localPlayer) end Link to comment
Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 try this and tell me if you got all the debugstrings: addCommandHandler("removeObject",function() showCursor(true) outputDebugString("now you could click") addEventHandler("onClientClick", root, clickRemoveObject) end) function clickRemoveObject(button, state, x, y) outputDebugString("Started") local cx,cy,cz = getCameraMatrix() wx, wy, wz = getWorldFromScreenPosition(x,y, 1000) hit,hitX, hitY, hitZ,hitElement,normalX, normalY, normalZ,material,lighting,piece,worldModelID,wpX,wpY,wpZ,wrX,wrY,wrZ = processLineOfSight(cx,cy,cz,wx,wy,wz, true, false ,false, false, true, true, true, true, nil, true ) removeWorldModel ( worldModelID, 50, wpX, wpY, wpZ ) setCameraMatrix( wpX, wpY, wpZ + 500 ) setTimer(setCameraTarget, 100, 1,localPlayer) outputDebugString("Stoped") end Link to comment
Slothman Posted April 10, 2012 Share Posted April 10, 2012 There is an issue currently with binary ipl objects not returning ids with that function. http://bugs.mtasa.com/view.php?id=7003 Link to comment
Fabio(GNR) Posted April 10, 2012 Author Share Posted April 10, 2012 That must be it, Slothman. Jaysd1, it's not my script because it does return material etc. Link to comment
Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 That must be it, Slothman. Jaysd1, it's not my script because it does return material etc. ok, sorry, should've checked bugs Link to comment
Slothman Posted April 10, 2012 Share Posted April 10, 2012 i actually just posted the bug a minute ago Link to comment
Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 oh, ok, never mind what I said before Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now