
arezu
Members-
Posts
446 -
Joined
-
Last visited
Everything posted by arezu
-
It should work for all scripts that uses dxDrawText, so yes.
-
You could use my custom dxDrawText function here: https://community.multitheftauto.com/index.php?p= ... ls&id=3421 have that resource always running and use: exports.dxExtra:dxDrawColoredText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "pricedown", "center", "bottom", false, false, false ) instead of: dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "pricedown", "center", "bottom", false, false, false ) on line 80.
-
Can't figure out what to do with Element functions&Markers
arezu replied to TheMtaUser555's topic in Scripting
attaching a marker doesn't work because of mta bug (the marker changes position only visually) use colshape instead. -
example: local screenWidth, screenHeight = guiGetScreenSize() local recWidth = screenWidth local recHeight = 75 dxDrawRectangle(0, screenHeight - recHeight, recWidth, recHeight, tocolor(0, 0, 0, 192), false)
-
y position would be screenHeight - rectangleHeight. (you dont have rectangleHeight variable, so just make one)
-
creating a ped and attaching it to the vehicle and then firing with its weapon is a bad idea, it wont work because of a mta or gta bug where the bullets go in the opposite direction downwards of the vehicle velocity (if you try to shoot forward, you will shoot your own vehicle) creating a few rc's (or a hunter) and then attach it at the same position as a minigun object and then setElementSyncer would be best. (i have tried all these before, and this idea worked the best)
-
can you show how it looks like on other resolutions?
-
Dont listen to these guys, because it is possible by attaching that flying rc (whatever its called) to your vehicle and use setElementSyncer (or create a ped and control the peds keyState). you can attach it at the same position as the minigun and change alpha on the rc to 0.
-
what do you want it for?
-
I think he means nametags that shows hexadecimal colors. ... here i uploaded my custom dxDrawText function that supports hexadecimal colors: https://community.multitheftauto.com/index.php?p= ... ls&id=3421
-
for some reason, the returned value from createTeam cannot be used when trying to use team functions, using getTeamFromName should work, like the post above me did.
-
is that the whole script? because i dont see any variable called 'lua'.
-
if you would have used /debugscript 3, then you would have found out the problem(probably) teamChildNode = xmlCreateChild (teams, teamName) should be: teamChildNode = xmlCreateChild (teamXmlFile, teamName) because "teams" doesn't exist here as a xmlnode.
-
Pawn looks like Java and c, and Lua looks like... action script. Do you seriously mean that Pawn is easier than Lua? Pawn doesn't even look like a scripting language .
-
use rcg, or my toolbox.
-
1: You will have to make a custom function for that. 2: Open admin panel and search for dxscoreboard in resource tab list. Press on it and settings and enable hex colors.
-
In most scripting/programming language, semicolons are used, but in lua its optional (makes no difference if used or not).
-
If you dont want a stiff camera, you can make the offset change depending on vehicle velocity. so it faces the inverted direction of the velocity direction. you can use this for smoother camera: (note: if you dont want the camera to jump too much when changing direction, then get new value and old value and interpolate between the values with setCameraMatrix, for smooth animation.) local maxDist = 13 addEventHandler("onClientPreRender", getRootElement(), function() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if not vehicle then return end local tarX, tarY, tarZ = getElementPosition(vehicle) tarZ = tarZ + 1 local velX, velY, velZ = getElementVelocity(vehicle) local rotX, rotY, rotZ = getElementRotation(vehicle) local vel3D = (velX^2+velY^2+velZ^2)^0.5 if(vel3D == 0)then local camX, camY, camZ = getRotatedPosition(vehicle, 0, -maxDist, 1.5) --setCameraMatrix(camX, camY, camZ, tarX, tarY, tarZ) return end local relX = velX / vel3D local relY = velY / vel3D local relZ = velZ / vel3D local camX, camY, camZ = tarX, tarY, tarZ camX, camY, camZ = camX-relX*maxDist, camY-relY*maxDist, camZ-relZ*maxDist+1.5 local hit, hitX, hitY, hitZ = processLineOfSight(tarX, tarY, tarZ, camX, camY, camZ, true, false, false, true, false, true, true, true) local rot = 0 if hit and (rotX >= 45 and rotX <= 360-45)then rot = 180 camX, camY, camZ = getRotatedPosition(vehicle, 0, 0, 1.5) camX, camY, camZ = camX-relX*maxDist, camY-relY*maxDist, camZ-relZ*maxDist else rot = -rotY end setCameraMatrix(camX, camY, camZ, tarX, tarY, tarZ, rot) end) function getRotatedPosition(element, distX, distY, distZ) if not element or not isElement(element) then return end local matrix = getElementMatrix(element) if not matrix then return end local offX = distX * matrix[1][1] + distY * matrix[2][1] + distZ * matrix[3][1] + 1 * matrix[4][1] local offY = distX * matrix[1][2] + distY * matrix[2][2] + distZ * matrix[3][2] + 1 * matrix[4][2] local offZ = distX * matrix[1][3] + distY * matrix[2][3] + distZ * matrix[3][3] + 1 * matrix[4][3] return offX, offY, offZ end
-
why dont you just use getElementMatrix, if you want the camera to stay behind the player? edit: like this. addEventHandler("onClientPreRender", getRootElement(), function() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if not vehicle then if(getCameraTarget() ~= getLocalPlayer())then setCameraTarget(getLocalPlayer()) end return end local tarX, tarY, tarZ = getElementPosition(vehicle) tarZ = tarZ + 0.5 -- get position 13 units and 1 unit behind the vehicle. local camX, camY, camZ = getRotatedPosition(vehicle, 0, -13, 1) setCameraMatrix(camX, camY, camZ, tarX, tarY, tarZ) end) function getRotatedPosition(element, distX, distY, distZ) if not element or not isElement(element) then return end local matrix = getElementMatrix(element) if not matrix then return end local offX = distX * matrix[1][1] + distY * matrix[2][1] + distZ * matrix[3][1] + 1 * matrix[4][1] local offY = distX * matrix[1][2] + distY * matrix[2][2] + distZ * matrix[3][2] + 1 * matrix[4][2] local offZ = distX * matrix[1][3] + distY * matrix[2][3] + distZ * matrix[3][3] + 1 * matrix[4][3] return offX, offY, offZ end
-
try going into map settings in editor and reset your ghostmode settings etc and then save and try again.
-
should the player be able to rotate the camera or, just should the camera just be behind the player?
-
this lets you move all your objects in your map: http://mta.dzek.eu/mmove/