Jump to content

dxDrawing


CapY

Recommended Posts

Well i have this code , but it seems it doesn't working.

local root = getRootElement() 
local screenWidth, screenHeight = guiGetScreenSize() 
local player, accountName = "", "" 
      
function dxLogin() 
    dxDrawText( getPlayerName(player).." has logged into "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 
      
function dxLogout() 
    dxDrawText( getPlayerName(player).." have been logged out "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 

This is not the whole code.

I have errors on line 6 and 10.

attempt to concatenate upvalue 'accountName' (a nil value)

Link to comment

Try This :)

local root = getRootElement() 
local screenWidth, screenHeight = guiGetScreenSize() 
local player, accountName = "", "" 
      
function dxLogin() 
dxDrawText( getPlayerName(player).." has logged into "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 
      
function dxLogout() 
dxDrawText( getPlayerName(player).." have been logged out "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 

and get Account is Serverfunction see this

https://wiki.multitheftauto.com/wiki/GetAccountName

Link to comment
Try This :)
local root = getRootElement() 
local screenWidth, screenHeight = guiGetScreenSize() 
local player, accountName = "", "" 
      
function dxLogin() 
dxDrawText( getPlayerName(player).." has logged into "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 
      
function dxLogout() 
dxDrawText( getPlayerName(player).." have been logged out "..tostring(accountName), 354, screenHeight-703, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "pricedown" ) 
end 

and get Account is Serverfunction see this

https://wiki.multitheftauto.com/wiki/GetAccountName

read pot above

DX FUNCTIONS NEED TO BE TRIGGERED onClientRender TO CONSTANTLY DRAW SOMETHING, as this function only draws it for 1frame.

Link to comment

Below script it says : "this is not the whole code" , what part of that you didn't understand guys ?

you need to use dx functions with the event onClientRender.

seriously, you have like hundred of help topics, you should learn already.

and account cant be an empty string.

First read whole topic , then complain.

Link to comment

wtf?

since when shortening code means removing necessary parts from it?

how could any1 possibly tell that you did use that?

you may say its common sense, but as i've learnt, in scripting forum section common sense doesn't apply in half of the cases(for you too.).

Link to comment

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...