Jump to content

karlis

Members
  • Posts

    1,314
  • Joined

  • Last visited

Everything posted by karlis

  1. karlis

    I /load

    that is samp indeed, with a shitty objstreamer, but what you mean by speed?
  2. karlis

    VSync always on..

    are you sure frame limiter is off? get inside GTASA(not mta), and turn it off.
  3. karlis

    MTA 1.1 Map Editor

    uncheck precise object movement and rotation.
  4. karlis

    Building mods

    tank your post is as offtopic as their are, in fact mine is aswell. they're at least making a point.
  5. local black=tocolor(0,0,0,255) function dxDrawTextBordered(text,x1,y1,x2,y2,color,thickness,scale,font,alignX,alignY,textclip,wordbreak,postgui) for w=-thickness,thickness,thickness do for h=-thickness,thickness,thickness do if not(w==0 and h==0) then dxDrawText(text,x1+w,y1+h,x2+w,y2+h,black,scale,font,alignX,alignY,textclip,wordbreak,postgui) end end end dxDrawText(text,x1,y1,x2,y2,color,scale,font,alignX,alignY,textclip,wordbreak,postgui) end
  6. no difference, lua allows commas there.
  7. i think its reported, and already replied that its limitation of sa engine of some kind. may be mistaking tho.
  8. maybe he should use the code that u are using for ufo with slight modification that each frame cords of cam pos and cords of cam target are fliped?
  9. they wont destroy. u need to set timer to remove the subtable after a set ammount of time(imo 2sec would be good) also fading out would be good, but i guess thats out of basic help.
  10. if player has shot lately then draw 3dline from one of returns pos to other on client render.
  11. getPedTargetCollision getPedWeaponMuzzlePosition dxDrawLine3D
  12. karlis

    dxDrawing

    wtf? since when shortening code means removing necessary parts from it? how could any1 possibly tell that you did use that? you may say its common sense, but as i've learnt, in scripting forum section common sense doesn't apply in half of the cases(for you too.).
  13. i knew ur going to use that. something indestructible
  14. karlis

    dxDrawing

    read pot above DX FUNCTIONS NEED TO BE TRIGGERED onClientRender TO CONSTANTLY DRAW SOMETHING, as this function only draws it for 1frame.
  15. karlis

    dxDrawing

    you need to use dx functions with the event onClientRender. seriously, you have like hundred of help topics, you should learn already. and account cant be an empty string.
  16. that's just a little bug, ofc it'll get fixed, no worries.
  17. ok ive made the alpha, but needed to change SO much, basically all cords was in pixel position from screen corner, now they were needed to get changed to pixel pos relative to corner of dxRenderArea... that wasnt fun to do... also few more bugs are fixed and some optimization not long to go!
  18. by that i mean like giving real physics to it, that actually something effects it, not just button pressing and camera.
  19. ok done, took me 20min, sorry for so long waiting. local zoom=350 --how far is camera target from ufo local mouseFrameDelay = 0 local ratio = 3 --how many times distance from camera to ufo is smaller then distance from ufo to camera target local mouseSensetivity = 0.25 --ovbious much? local width, height = guiGetScreenSize() local PI = math.pi local hit local zOffset = 3 --how much the camera is higher then ufo itself. -- state variables local speed = 0 local rotX, rotY = 0,PI/1.5 -- configurable parameters local options = { invertMouseLook = false, normalMaxSpeed = 2, slowMaxSpeed = 0.2, fastMaxSpeed = 12, smoothMovement = true, acceleration = 0.3, decceleration = 0.15, maxYAngle = 188, key_fastMove = "lshift", key_slowMove = "lalt", key_forward = "w", } local rootElement = getRootElement() local getKeyState = getKeyState do local mta_getKeyState = getKeyState function getKeyState(key) if isMTAWindowActive() then return false else return mta_getKeyState(key) end end end --heavily modified freecam resource's core function freecamFrame() local cameraAngleX = rotX local cameraAngleY = rotY local freeModeAngleZ = math.sin(cameraAngleY) local freeModeAngleY = math.cos(cameraAngleY) * math.cos(cameraAngleX) local freeModeAngleX = math.cos(cameraAngleY) * math.sin(cameraAngleX) local camPosX, camPosY, camPosLastZ = getElementPosition(ufo) local camPosZ = camPosLastZ + zOffset local mspeed = options.normalMaxSpeed if getKeyState ( options.key_fastMove ) then mspeed = options.fastMaxSpeed elseif getKeyState ( options.key_slowMove ) then mspeed = options.slowMaxSpeed end if options.smoothMovement then local acceleration = options.acceleration local decceleration = options.decceleration -- Check to see if the forwards key are pressed local speedKeyPressed = false if getKeyState ( options.key_forward ) then speed = speed + acceleration speedKeyPressed = true end -- If no forwards key were pressed, then gradually slow down the movement towards 0 if not speedKeyPressed then speed = speed - decceleration end -- Check the ranges of values - set the speed to 0 if its very close to 0 (stops jittering), and limit to the maximum speed if speed < decceleration then speed = 0 elseif speed > mspeed then speed = mspeed end else speed = 0 if getKeyState ( options.key_forward ) then speed = mspeed end end -- Update the camera position based on the forwards/backwards speed ufoPosX = camPosX + freeModeAngleX * speed ufoPosY = camPosY + freeModeAngleY * speed camPosZ = camPosLastZ + freeModeAngleZ * speed -- calculate a target based on the current position and an offset based on the angle local camTargetX = ufoPosX + freeModeAngleX * zoom local camTargetY = ufoPosY + freeModeAngleY * zoom local camTargetZ = camPosZ + freeModeAngleZ * zoom camPosX = ufoPosX - ( camTargetX - ufoPosX ) / ratio camPosY = ufoPosY - ( camTargetY - ufoPosY ) / ratio camPosZ = camPosZ - ( camTargetZ - camPosZ ) / ratio if not isLineOfSightClear(ufoPosX,ufoPosY,camPosLastZ,camPosX,camPosY,camPosZ,true,true,true,true,false,true,false,realufo) then _,camPosX,camPosY,camPosZ=processLineOfSight(ufoPosX,ufoPosY,camPosLastZ,camPosX,camPosY,camPosZ,true,true,true,true,false,true,false,false,realufo) end -- Set the new camera position and target setElementRotation(ufo,0,0,-math.deg(rotX)) setElementPosition(ufo,ufoPosX,ufoPosY,camPosLastZ) setCameraMatrix ( camPosX, camPosY, camPosZ, camTargetX, camTargetY, camTargetZ ) end function freecamMouse(_,_,aX,aY) --ignore mouse movement if the cursor or MTA window is on --and do not resume it until at least 5 frames after it is toggled off --(prevents cursor mousemove data from reaching this handler) if isCursorShowing() or isMTAWindowActive() then mouseFrameDelay = 5 return elseif mouseFrameDelay > 0 then mouseFrameDelay = mouseFrameDelay - 1 return end if options.invertMouseLook then aY = -aY end -- how far have we moved the mouse from the screen center? aX = aX - width / 2 aY = aY - height / 2 rotX = rotX + aX * 0.01745 * mouseSensetivity rotY = rotY - aY * 0.01745 * mouseSensetivity if rotX > PI then rotX = rotX - 2 * PI elseif rotX < -PI then rotX = rotX + 2 * PI end if rotY > PI then rotY = rotY - 2 * PI elseif rotY < -PI then rotY = rotY + 2 * PI end -- limit the camera to stop it going too far up or down - PI/2 is the limit, but we can't let it quite reach that or it will lock up -- and strafeing will break entirely as the camera loses any concept of what is 'up' if rotY < -PI / 3 then rotY = -PI / 3 elseif rotY > PI / 3 then rotY = PI / 3 end -- work out an angle in radians based on the number of pixels the cursor has moved (ever) end addEventHandler("onClientRender", root, freecamFrame) addEventHandler("onClientCursorMove", root, freecamMouse) NOTE: as camera start is about 120m from the ufo, and on start its facing up,don't let the camera get stuck under the map by putting the ufo about 150m in air on start. PS: the handling is too plain imo...its good for a freecam, but not a psyhical object, even tough its hightech. you should probably a bit influence it by wind velocity, and add a bit of gravity, inertia, rotation inertia, stuff like that. if ill finish ivhud ill help you.
  20. karlis

    Greenzone

    still, its not very hard to make create colshape and radar area serverside, detect onplayerdamage clientside, and cancel if ure inside the colshape.
  21. however don't put in the client anything you don't trust the client. for example password management clientside is a nonono.
  22. and yes, there's a lot of stuff dedicated to GTA
  23. "could you work on other feats until that?i think u had a compromised version that did work in some way." lol actually just a post from other topic that i moved from new post to edit
×
×
  • Create New...