Jump to content

Recommended Posts

Posted (edited)

Translated by Google Translate.

Hello, I come to ask for help on Graphics DrawText because I am not able to display it on the screen. I took the sample code found on Wiki Rage and placed it inside: (server-files/client_packages/{myserver}/hud/time.js) as shown in the code below:

mp.events.add('render', () => {
    // Draw to screen.
    mp.game.graphics.drawText("Text at the top of the screen", [0.5, 0.005], { 
      font: 7, 
      color: [255, 255, 255, 185], 
      scale: [1.2, 1.2], 
      outline: true
    });

    // Draw to world.
    mp.game.graphics.drawText("Text in the world", [-1234, 1337, 15], { 
      font: 7, 
      color: [255, 255, 255, 185], 
      scale: [1.2, 1.2], 
      outline: true,
      centre: true
    });
});

That done, should the texts appear on my screen? Was there a command missing that makes them appear? Am I doing something wrong? I have already studied several codes from other users such as (Money API - rootcause) that uses DrawText but I was not successful in passing part of the code to my project.

Thanks in advance to anyone who wants to help me.

Edited by BrendonPawn
Fix
Posted

Try to put in ur time.js file mp.gui.chat.push.
Like: mp.gui.chat.push('time.js was called');

If it doesn't appear, the problem is in importing files or etc.

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...