Dorega Posted February 9, 2013 Posted February 9, 2013 Is there any script or something which can make my sniper to zoom very fast? + auto zoom?
Jaysds1 Posted February 10, 2013 Posted February 10, 2013 Nope, sorry 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/
Moderators IIYAMA Posted February 17, 2013 Moderators Posted February 17, 2013 ehhhhhhhhhhhhhhhhhhhhh Possible to make, but I can promise you it isn't 20 line's of code. everything is possible :3 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Dorega Posted February 19, 2013 Author Posted February 19, 2013 could you help me to do this, please?
Moderators IIYAMA Posted February 21, 2013 Moderators Posted February 21, 2013 Well I am very interesting in weapon syncs so, yes I did try. I tried the easy way, the way without all those special lines for locating the sniper. --client addEventHandler ( "onClientRender", root, function () if getControlState ("aim_weapon" ) then if getPedWeapon (getLocalPlayer ())== 34 then setControlState ( "zoom_out", true )--zoom_in.... -_-" setControlState ( "aim_weapon", true) end end end) but it worked out very strang, I am not sure if the same happens to you. First I added zoom_in, but some how this script zoomed out... so I used zoom_out instead... and this ..... script started to zoom in for me. wtf! ------------------ but a harder way: --server setWeaponProperty(34,"pro","flags",0x000008) --client addEventHandler ( "onClientRender", root, function () local player = getLocalPlayer () if getPedWeapon (player)== 34 then if getControlState ("aim_weapon" ) then local xs, ys, zs = getPedWeaponMuzzlePosition ( player ) local xe, ye, ze = getPedTargetEnd(player) --getPedRotation(player) setCameraMatrix ( xs, ys, zs, xe, ye, ze) setControlState ( "aim_weapon", true) dxDrawLine3D ( xs, ys, zs, xe, ye, ze, tocolor(255,0,0,255), 1, false, 1 ) elseif getCameraTarget (player)~= player then setCameraTarget ( player ) end end end) ------------- --server setWeaponProperty(34,"pro","flags",0x000008) --client addEventHandler ( "onClientRender", root, function () local player = getLocalPlayer () if getPedWeapon (player)== 34 then if getControlState ("aim_weapon" ) then --if getControlState ("fire" ) then local xs, ys, zs = getPedWeaponMuzzlePosition ( player ) local xe, ye, ze = getPedTargetEnd(player) --getPedRotation(player) --setCameraMatrix ( xs, ys, zs, xe, ye, ze) -- setControlState ( "aim_weapon", true) dxDrawLine3D ( xs, ys, zs, xe, ye, ze, tocolor(255,0,0,255), 1, false, 1 ) -- elseif getCameraTarget (player)~= player then --setCameraTarget ( player ) -- end local x, y, z, lx, ly, lz = getCameraMatrix() if x and y and lx and ly then local zc = findRotation(x,y,lx,ly) setElementRotation(player,0,0,zc) end end end end) -- source wiki mta >> function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end --<< It does not work even 40%, many bugs etc. -_-" If you really wanna have this you have to ask your pcp mates, they seems to have good scripters. You are from the bomb da base server right? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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