Jump to content

qaisjp

Retired Staff
  • Posts

    2,344
  • Joined

  • Days Won

    10

Everything posted by qaisjp

  1. Well, just moves on a X and Y axis depending on where the camera is showing at. Z will be added later via scroll. edit: NEW UPDATE! To get the latest script click below, remember this is incomplete! c_core : http://pastebin.com/W46QjvR1 s_core : http://pastebin.com/5URwcGNa Implemented Z movement via scrolling mouse wheel. Implemented extras menu. Color codes: RED/GREEN = Boolean. Yellow = window lightblu/cyan = action Only one of them are added atm. That is the option to toggle scrolling Again, i request someone to model a new ufo (preferably with an interior ) and I need someone to edit the end of the script (freecam part ONLY) to make sure the camera shows the entire ufo Please.
  2. Lol, I will be learning vectors and matrices in a few months, and atm i don't know what they are. So...how do I get the rotation of the cam vect and apply it to the obj? (getCameraMatrix?) UPDATE!! http://pastebin.com/W46QjvR1 The ufo moves using camera (only by W [accel], i disabled strafing and backward) In the code I want the ufo view to be like how is was in the code karlis gave me (uncomment that bigblock and comment below it).. but I'm not sure how..
  3. Add it to the admin..
  4. [OFFTOPIC]lol you want to show people a girl? (http://blabla.tk exists) (yeah i know, you wanted to put smth else there ;P)
  5. That explain's why the camera doesn't move Sorry about last night, i fell asleep karlis, i don't think I will use your edit, probably just a part of it. Since I wouldn't have to recreate the moving. I think, that rotating the screen look-at should rotate the UFO. You should only be allowed to move FORWARD, and to turn around you have to rotate the ufo. If someone modelled a new ufo for me, then it would also be moving from the front of the ufo. To get the latest script click below, remember this is incomplete! c_core : http://pastebin.com/W46QjvR1 s_core : http://pastebin.com/5URwcGNa
  6. Sorry about the bump but: Here is the current progress, i will update it whenever I feel like doing so. client --[[ This resource has been created by qaisjp Find more epic resources at [url=http://www.code.google.com/p/mta-freeroamplus]http://www.code.google.com/p/mta-freeroamplus[/url] Please give me credit! ]] local function iif(a,b,c) if a then return b else return c end return nil end local me, ufo = getLocalPlayer(), getElementByID("ufo") local data = {} local sW, sH = guiGetScreenSize() local mapSize = iif((sH - 100)>=600, 600, sH - 100) local mapX = (sW / 2) - (mapSize / 2) local mapY = (sH / 2) - (mapSize / 2) function tse(st,...) local args = {...} triggerServerEvent(st, root, unpack(args)) end function createEvent(str, hand, func) addEvent(str, true) addEventHandler(str, hand, func) end --[[ addEventHandler("onClientGUIClick", button_fun, toggleFunWindow, false) opens the fun stuff. we will have a gridlist attch to btn addEventHandler("onClientGUIClick", button_map, mapUfoInit, false) warp to map triggerServerEvent("ufo:dirHeight", root,tonumber(theHeight)) addEventHandler("onClientGUIClick", button_quickmap_go, function() pointX = tonumber( guiGetText(edit_coord) ) pointY = tonumber( guiGetText(edit_coord_2)) speed = guiGetText(edit_speed) superSpeed = speed * 1000 z = "nothing" if speed and pointX then tse("ufo:moveEvent", tonumber(pointX), tonumber(pointY), z, true, tonumber(superSpeed)) end end , false) bla bla notes here bla bla bla bla height_up, function() triggerServerEvent("ufoHeight", root, 3) end, false) height_down, function() triggerServerEvent("ufoHeight", root, -3) end, false) movement_stop, function() triggerServerEvent("ufoStop", root) end, false) LS, function() triggerServerEvent("ufo:move2Loc", root, 835.6, -2086, 500) end, false) SF, function() triggerServerEvent("ufo:move2Loc", root, -1357.7, 532.4, 500) end, false) LV, function() triggerServerEvent("ufo:move2Loc", root, 2415, 507, 500) end, false) nw, function() triggerServerEvent("ufo:moveEvent", root, -160, 160, 0) end, false) n, function() triggerServerEvent("ufo:moveEvent", root, 0, 160, 0) end, false) ne, function() triggerServerEvent("ufo:moveEvent", root, 160, 160, 0) end, false) e, function() triggerServerEvent("ufo:moveEvent", root, 160, 0, 0) end, false) se, function() triggerServerEvent("ufo:moveEvent", root, 160, -160, 0) end, false) s, function() triggerServerEvent("ufo:moveEvent", root, 0, -160, 0) end, false) sw, function() triggerServerEvent("ufo:moveEvent", root, -160, -160, 0) end, false) w, function() triggerServerEvent("ufo:moveEvent", root, -160, 0, 0) end, false) rot_45nw, function() triggerServerEvent("ufo:rotateUfo", root, 0, 0, 45) end, false) rot_45ne, function() triggerServerEvent("ufo:rotateUfo", root, 0, 0, -45) end, false) rot_90ne, function() triggerServerEvent("ufo:rotateUfo", root, 0, 0, -90) end, false) rot_90nw, function() triggerServerEvent("ufo:rotateUfo", root, 0, 0, 90) end, false)]] local guiContainer = {} function getControl(child) return guiContainer[child] end function mouseToggle() showCursor(not isCursorShowing()) end function showMenu() if data.enabled then return end toggleControl("enter_exit", false) bindKey("f", "down", mouseToggle) showCursor(true) local additions = {"stopedit", "showextras", "extragrid", "mapaccess", "pref"} for i,v in ipairs(additions) do local gui = getControl(v) guiSetVisible(gui, true) end data.enabled = true end addCommandHandler("ufo", showMenu) function hideMenu() data.enabled = false local additions = {"stopedit", "showextras", "extragrid", "mapaccess", "pref"} for i,v in ipairs(additions) do local gui = getControl(v) guiSetVisible(gui, false) end showCursor(false) toggleControl("enter_exit", true) unbindKey("f", "down", mouseToggle) end ------------------- --///////////////--: Create the main screen objects ------------------- -- Leave movement mode guiContainer["stopedit"] = guiCreateButton(0.7825,0.0583,0.205,0.0617,"Stop Editing",true) addEventHandler("onClientGUIClick", getControl("stopedit"), hideMenu) -- Create the extras menu, to do is sliding the extras gridlist up and down to toggle showing, also moving the btns below it. guiContainer["showextras"] = guiCreateButton(0.7825,0.135,0.205,0.0617,"Show Extras",true) guiSetProperty(getControl("showextras"),"AlwaysOnTop","True") guiContainer["extragrid"] = guiCreateGridList(0.7837,0.155,0.2025,0.37,true) guiGridListSetSelectionMode(getControl("extragrid"),2) guiSetProperty(getControl("extragrid"),"ZOrderChangeEnabled","False") guiGridListAddColumn(getControl("extragrid"),"",0.1) guiContainer["mapaccess"] = guiCreateButton(0.7825,0.54,0.205,0.0617,"Quick Map",true) guiContainer["pref"] = guiCreateButton(0.7825,0.6133,0.205,0.0617,"Preferences",true) for i = 1, 6 do guiGridListAddRow(getControl("extragrid")) end ------------------- --///////////////-- ------------------- for i,v in pairs(guiContainer) do guiSetVisible(v, false) end ------------------- --///////////////-- ------------------- -- This contains content from the freecam resource and has been editied by karlis, so thanks to him. local zoom=10 --how far is camera target from elem rotX, rotY = 0,0 local mouseFrameDelay = 0 local ratio = 3 --how many times distance from camera to player is smaller then distance from player to camera target local offset = 0.4 --how much the camera goes to the right from the player (negative for the left) local mouseSensetivity = 0.25 --ovbious much? local width, height = guiGetScreenSize() local PI = math.pi local hit --heavily modified freecam resource's core function freecamFrame() if not data.enabled then return end do local additions = {"stopedit", "showextras", "extragrid", "mapaccess", "pref"} for i,v in ipairs(additions) do local gui, show = getControl(v), isCursorShowing() guiSetAlpha(gui, show and 1 or 0.9) guiSetEnabled(gui, show) end end 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, camPosZ = getElementPosition(ufo) -- calculate a target based on the current position and an offset based on the angle local camTargetX = camPosX + freeModeAngleX * zoom local camTargetY = camPosY + freeModeAngleY * zoom local camTargetZ = camPosZ + freeModeAngleZ * zoom local camPosX = camPosX - ( camTargetX - camPosX ) / ratio local camPosY = camPosY - ( camTargetY - camPosY ) / ratio local camPosZ = camPosZ - ( camTargetZ - camPosZ ) / ratio if not isLineOfSightClear(camPosX,camPosY,camPosZ,camPosX,camPosY,camPosZ,true,true,true,true,false,true,false,me) then _,camPosX,camPosY,camPosZ=processLineOfSight(camTempPosX,camTempPosY,camPosZ,camPosX,camPosY,camPosZ,true,true,true,true,false,true,false,false,localPlayer) camPosX,camPosY,camPosZ=camPosX-(camTempPosX-camPosX)*0.1,camPosY-(camTempPosY-camPosY)*0.1,camPosZ-(camTempPosZ-camPosZ)*0.1 end -- Set the new camera position and target setCameraMatrix ( camPosX, camPosY, camPosZ, camTargetX, camTargetY, camTargetZ ) end addEventHandler("onClientRender", root, freecamFrame) 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 not data.enabled then return end if isCursorShowing() or isMTAWindowActive() then mouseFrameDelay = 5 return elseif mouseFrameDelay > 0 then mouseFrameDelay = mouseFrameDelay - 1 return 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("onClientCrsorMove", root, freecamMouse) server allowAll = false local ufo = createObject ( 13607, -1326, -67, 55, 0, 0, 0 ) createBlipAttachedTo ( ufo, 37 ) setElementData(ufo, "vglueable", true, true) setElementDoubleSided( ufo, true) setElementID(ufo, "ufo") addCommandHandler("gotoufo", function(thePlayer) if thePlayer then ufoWarpPlayer(thePlayer) end end ) addCommandHandler("ufoheight", function(thePlayer, cmd, height) ufoSetHeight(height) end ) -- Zap thingy function zapMeUp() local x,y,z = getElementPosition(ufo) triggerClientEvent ( "ufo:ClientFireN", getRootElement(), x, y, z - 50 ) end addEvent("zapUFO", true) addEventHandler("zapUFO", getRootElement(), zapMeUp) addEvent("ufo:warp_player_to_ufo", true) function ufoWarpPlayer(pl) local x,y,z = getElementPosition(ufo) setElementPosition(pl, x, y, z + 0.5) end addEventHandler("ufo:warp_player_to_ufo", getRootElement(), ufoWarpPlayer) function ufoSetHeight(height) if tonumber(height) then local x,y,z = getElementPosition(ufo) setElementPosition(ufo, x, y, tonumber(height)) end end addEvent("ufo:dirHeight", true) addEventHandler("ufo:dirHeight", getRootElement(), ufoSetHeight) function stopMove() stopObject(ufo) end addEvent("ufoStop", true) addEventHandler("ufoStop", getRootElement(), stopMove) -- ufo raise/lower/reset function ufoHeight(theValue) local x, y, z = getElementPosition(ufo) if (theValue == 5.5) then moveObject(ufo, 0, x, y, 5.5) else moveObject(ufo, 5000, x, y, z + theValue) end end addEvent("ufoHeight", true) addEventHandler("ufoHeight", getRootElement(), ufoHeight) -- ufo warper function ufoWarper(x, y, z) moveObject(ufo, 0, x, y, z) end addEvent("ufo:move2Loc", true) addEventHandler("ufo:move2Loc", getRootElement(), ufoWarper) -- Directional movement controls function ufoMove(, yD, zD, direct,speed) local x,y,z = getElementPosition(ufo) if not direct then moveObject(ufo, 20000, x + , y + yD, z + zD) elseif direct then moveObject(ufo, speed, ,yD,z) end end addEvent("ufo:moveEvent", true) addEventHandler("ufo:moveEvent", getRootElement(), ufoMove) -- Rotational movement controls function rotateUfoFunc(rX, rY, rZ) local x,y,z = getElementPosition(ufo) moveObject(ufo, 5000, x, y, z, rX, rY, rZ) end addEvent("ufo:rotateUfo", true) addEventHandler("ufo:rotateUfo", getRootElement(), rotateUfoFunc) -- **************************************** -- * Super weapons - Ion Nuke - By Ransom * -- **************************************** function NukeFinished () N_Active = false end addEvent("ufo:serverNukeFinished", true) addEventHandler("ufo:serverNukeFinished", root, NukeFinished) function KillNukedPlayer () killPed( source ) outputChatBox ( "#ff0000*UFO: #ffff00You got attacked by the UFO!", source, 105, 252, 55, true ) end addEvent("ufo:serverKillNukedPlayer", true) addEventHandler("ufo:serverKillNukedPlayer", root, KillNukedPlayer) code is verry messy atm.but if you test it ingame, type /ufo and press f to toggle. @Karlis, the camera fails.
  7. Basically freecam style, i love that idea. I don't know how I will manage colliding with sa maps. I don't know what the definition of inertia is but i will google it now. The camera will fit to show the entire ufo on the screen. Thanks for the great idea: Now who is thinking of making a UFO texture+model? I will definitely start doing that! =) thx for the idea
  8. I created this resource and won't probably be updated unless I am extremely bored. Oh wait, I am extremely bored Time to remake this. What do you mean as a zoomed out cam + bulky handling +karlis? EDIT: Oh btw I deleted this off the commnity, i will update with new link. EDIT AGAIN: Updated title, and forum topic and downloads.
  9. EPIC QUOTE: http://pastebin.com/pNs9i4mt
  10. qaisjp

    Shaders

    I'll need that script for the first screenie, JR10. Please send it to me, and btw Tank07 im already making that minigame (FOR freeroam+)
  11. OVERNINETHOUSAN spartan babies
  12. webadmin, [web] folder. start em all.
  13. local x,y,w,h = 0.2611, 0.5067, 0.4826, 0.1111 local blood = guiCreateStaticImage(x,y,w,h,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 2000, 1, blood, false ) setGameSpeed(tonumber(3) setTimer(setGameSpeed, 1, 5000, 1) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) It's not nice if you are addressing someone for help, but posting in a forum.
  14. function checkClass(hitElement, matchingDimension) if ( getElementType(hitElement) == "vehicle" ) then hitElement = getVehicleController(hitElement) end if not isElement(hitElement) then return end for i=0,#gateList do if not getPlayerTeam(hitElement) then return end local name = getTeamName(getPlayerTeam(hitElement)) if(name == false) then name = "false" end if ( name == team[i] or name == "false") then detection = isElementWithinColShape ( hitElement, shapes[i] ) if detection == true then move(i, false) end end end end Try that.
  15. a. qaisjp is god, the last time he posted. q. Who is betty? UGLY BETTY ?
  16. Yeah! I forgot to put return. Stupidomeh thx for the fix TAPL and thanks you FWCentral
  17. local x,y,blood = guiGetScreenSize(), guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 5000, 1, blood, false ) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted)
  18. Nope. but you could loop all gui elements and do guigetvisible function isWindowShowing() local lol = false for i,v in pairs(getElementsByType("gui-window")) end if guiGetVisible(v)==true then lol = true end end end UNTESTED
×
×
  • Create New...