
karlis
Members-
Posts
1,314 -
Joined
-
Last visited
Everything posted by karlis
-
hmm, lol ill need to script timer and velocity counter... or should i just divide the air consumption by 0.6 if im not moving at that 1/10 second?
-
i measured following data: drown time on foot:12sec drown time in car:18sec regenerate time:10sec could someone re-test it and disapprove/approve it?
-
you have to rescript the camera engine totally.
-
yes, with setCameraMatrix
-
setHeatHaze() (from 1.1 tough.) setBlurLevel() (dunno is it possible to have it on foot.)
-
local x, y, z, x1, y1, z1 local fpcam = false bindKey( "F2", "down", function() if fpcam then setCameraTarget(getLocalPlayer(), getLocalPlayer()) end fpcam = not fpcam end ) addEventHandler("onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition(getLocalPlayer(), 6) if isPedInVehicle(getLocalPlayer()) and (getControlState"left" or getControlState"right") then local _,_,Zrot=getElementRotation(getPedOccupiedVehicle(getLocalPlayer())) x1,y1=getPointFromDistanceRotation(x,y,(x1^2+x1^2)^0.5,Zrot) end setCameraMatrix(x, y, z, x + x1, y + y1, z + z1) dxDrawImage(screenWidth/2-10, screenHeight/2-10, 20, 20, "images/aimer.png") local tarX, tarY, tarZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 30) setPedAimTarget(getLocalPlayer(), tarX, tarY, tarZ) end) function getPointFromDistanceRotation(x,y,dist,angle) local a=math.rad(90-angle) local dx=math.cos(a)*dist local dy=math.sin(a)*dist return x+dx,y+dy end addEventHandler("onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end )
-
i suggest to re-read the 1st post, that works, he just hate that he have to turn cam manually on turns. btw i still failed with advice aswell, editing it now.
-
yep ill be careful, but as download is here, anyone can compare, is it theft or not, so the safety is same as i would just release it to community. only reason i didn't upload it yet to community, is just cuz i don't want get 1/5 rating just of some bug i didn't fix yet. heres the current code: http://www.4shared.com/file/Tm3lmMjA/IVhud.html DISCLAIMER:the code is not complete, so be aware that something may not be finished or optimized, as it should be.
-
get the car Z rotation, then calculate wx, and wy with function function getPointFromDistanceRotation(x,y,dist,angle) local a=math.rad(90-angle) local dx=math.cos(a)*dist local dy=math.sin(a)*dist return x+dx,y+dy end by using this if getControlState"left" or getControlState"right" then local _,_,Zrot=getElementRotation(getPedOccupiedVehicle(getLocalPlayer())) wx,wy=getPointFromDistanceRotation(cx,cy,((cx-wx)^2+(cy-wy)^2)^0.5,Zrot) end
-
ok, i can release alpha, but i wont upload on community yet.
-
thanks for support for those who are asking about settings, heres current list of variables, that can easy be changed, and most likeley will be in settings. local minVel = 0.3 --velocity, from witch on radar zoom will go bigger local minDist = 180 --minimum radius of radar in meters, with zoom 1. local maxVel = 1 --at witch point maxDist will take effect local maxDist = 360 --[[maximum radius of map in meters, shown with 1 zoom, ,if velocity of car is maxVel or higher.You can change it, bot dont make it any bigger.]] local minZoom = 1 --minimum changebale zoom local maxZoom = 3 --maximum changeable zoom local zoom=1 --default zoom local zoomPlus="=" --key to zoom in the radar local zoomMinus="-" --key to zoom out the radar local toogleHUDKey="num_mul" --key to toogle HUD local mapSize=4096 --dimensions of radar map included in res, change it if you change the map local sx,sy=guiGetScreenSize() --ovibious, dont change it. local size=110/924*(sy+100) --[[radius of radar, do this*1.3 to get actual radius of radar in pixels. Is affected by resolution.]] local x,y=size*1.5,sy-size*1.5 --position of center of hud on screen local dxSize=math.max(sy/1024,0.8 ) --size of blip texts, is affected by screen size local dxFont="arial" --font of blip texts local screenSizeCompensate=sy/500 --how much will blip size be affected by your resolution local blipDimension=16*screenSizeCompensate --default size blip dimension local textColor=tocolor(200,200,200,255) --default color of blip texts local backgroundCol=tocolor(0,0,0,160) --color of blip text background local hpCol=tocolor(20,90,20,255) --color of HP bar local armorCol=tocolor(10,50,100,255) --color of armor bar local ringCol=tocolor(30,30,30,255) --color of hud ring local inRingCol=tocolor(0,0,0,255) --color of armour & HP bar bakground
-
no, and btw should i add a possibility that in race mode hp and armor is replaced with speed and hp of car?
-
omg, then POST the script theres no timer in that code
-
stop ALL resources then start, only freeroam and play, and maapmanager, hud need to be there.
-
you can use showPlayerHudComponent(player,component,show)
-
do you know what wiki is? https://wiki.multitheftauto.com/
-
IT IS BY DEFAULT IM SURE MUCH MORE or you are just getting black screen? also check, didn't you turn hud off in gta singleplayer.
-
just better do this addEventHandler("onClientResourceStart",getResourceRootElement(),function() players=getElementsByType("player") setTimer(function() for k,v in ipairs(players) do --do what u want end end,put_your_time_here,0) end) addEventHandler("onClientPlayerJoin",getRootElement(),function() players[#players+1]=source end) addEventHandler("onClientPlayerQuit",getRootElement(),function() for k,p in ipairs(players) do if source==p then table.remove(players,k) end end end)
-
guiSetVisible(element gui-widget,bool visible)
-
define gui size before the function, as it doesn't change.
-
i gotta admit the code is pretty noob made, someone forgot about xml, mysql, or at least tables, i recommend re-scripting it, and it'll take 5times less space, and will be less lag and use [lua][ /lua] or [ /code] tags.heres a deal, put those cockpit values in proper table with veh id as a key, and ill help you adjust the code.
-
1)your now talking about code we don't see, show it 2)use [ /code] or i refuse to help you.
-
just add the value you need to offsets, it SHOULD change and why, i explained 2 reasons above
-
even more compact getPlayerSpeed(player,mph) local velX,velY,velZ=getElementVelocity(getPedOccuipiedVehicle(player) or player) return (velx^2+velY^2+velZ^2)^0.5*(mph and 100 or 161) end true, but omg what i was a noob, i forgot to put "function" word at first!! EDIT:lol how we found it out same time.
-
if not getAccount(name) then --register end