Almeidowski Posted August 29, 2020 Share Posted August 29, 2020 (edited) Hello. I'm trying to make this script where my coordinates are displayed near the radar. However, it's all buggy for some reason, as you can see in the image in the link: https://imgur.com/cRm9eFK What are all those weird shapes? My code is as follows: mp.events.add('render', () => { var x = String(mp.players.local.position.x) var y = String(mp.players.local.position.y) var z = String(mp.players.local.position.z) var tamanho = 5 var xCortado = x.substring(0, tamanho); var yCortado = y.substring(0, tamanho); var zCortado = z.substring(0, tamanho); mp.game.graphics.drawText('X: ' + xCortado + ' Y: ' + yCortado + ' Z: ' + zCortado, [0.2, 0.8], { font: 2, color: [197, 255, 0, 230], scale: [0.5, 0.5], outline: false }); }); It continues to bug if I don't add the last 4 variables. mp.events.add('render', () => { var x = String(mp.players.local.position.x) var y = String(mp.players.local.position.y) var z = String(mp.players.local.position.z) mp.game.graphics.drawText('X: ' + x + ' Y: ' + y + ' Z: ' + z, [0.2, 0.8], { font: 2, color: [197, 255, 0, 230], scale: [0.5, 0.5], outline: false }); }); Why is the drawText showing up like this? How can I fix it? @EDIT I figured out that the full squares represent ' - ' (negative numbers) and the empty squares are ' . ' @EDIT2 The only problem was the font. I changed the font and it fixed Edited August 30, 2020 by Almeidowski Link to comment Share on other sites More sharing options...
Xabi Posted August 30, 2020 Share Posted August 30, 2020 Why would you convert the coordinates to String? Link to comment Share on other sites More sharing options...
brosiden Posted August 30, 2020 Share Posted August 30, 2020 mp.events.add('render', () => { var x = mp.players.local.position.x; var y = mp.players.local.position.y; var z = mp.players.local.position.z; mp.game.graphics.drawText('X: ' + x + ' Y: ' + y + ' Z: ' + z, [0.2, 0.8], { font: 2, color: [197, 255, 0, 230], scale: [0.5, 0.5], outline: false }); }); Link to comment Share on other sites More sharing options...
radu9502 Posted August 31, 2020 Share Posted August 31, 2020 try another font. use font: 4 Link to comment Share on other sites More sharing options...
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