Fabio(GNR) Posted April 10, 2012 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. LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
Jaysds1 Posted April 10, 2012 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Fabio(GNR) Posted April 10, 2012 Author Posted April 10, 2012 Didn't see anything change but, didn't work. LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
Jaysds1 Posted April 10, 2012 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Fabio(GNR) Posted April 10, 2012 Author Posted April 10, 2012 Didn't work. 0.o LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
Jaysds1 Posted April 10, 2012 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Slothman Posted April 10, 2012 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 Check out my recent work: ZDay - a zombie script Slothbot - an AI deathmatch bot my community profile (all my resources)
Fabio(GNR) Posted April 10, 2012 Author Posted April 10, 2012 That must be it, Slothman. Jaysd1, it's not my script because it does return material etc. LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
Jaysds1 Posted April 10, 2012 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Slothman Posted April 10, 2012 Posted April 10, 2012 i actually just posted the bug a minute ago Check out my recent work: ZDay - a zombie script Slothbot - an AI deathmatch bot my community profile (all my resources)
Jaysds1 Posted April 10, 2012 Posted April 10, 2012 oh, ok, never mind what I said before My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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