Jump to content

dxDrawing


CapY

Recommended Posts

Posted

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)

Posted

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

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

Posted

CaPy, when you asked me for help via PM, I sent you the script with the event handler of "onClientRender", you took it off?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

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