Jump to content

Help dxdrawText :(


^Dev-PoinT^

Recommended Posts

Hi all who to Make dxdraw Money For Players :(

i have Made Half of it

but i dont understand dxdrawText :(

exports.scoreboard:addScorboardColumn('Money') 
  
function M () 
local money = getPlayerMoney (source) 
setElementData (source, "Money", "$".. money ) 
    end 
end 
addEventHandler ("onPlayerSpawn", getRootElement(), M ) 
  
function xxx () 
local screenWidth, screenHeight = guiGetScreenSize() 
local name = getPlayerName() 
local money = getPlayerMony(thePlayer) 
  

:roll:

Link to comment

Can you tell me what the link between this

exports.scoreboard:addScorboardColumn('Money') 
  
function M () 
local money = getPlayerMoney (source) 
setElementData (source, "Money", "$".. money ) 
    end 
end 
addEventHandler ("onPlayerSpawn", getRootElement(), M ) 

and this

function xxx () 
local screenWidth, screenHeight = guiGetScreenSize() 
local name = getPlayerName() 
local money = getPlayerMony(thePlayer) 

you want dxDrawText

i don't understand why you put a script for add money in Scoreboard

----------------

this make no sense.

function xxx () 
local screenWidth, screenHeight = guiGetScreenSize() 
local name = getPlayerName() 
local money = getPlayerMony(thePlayer) 

look at wiki

https://wiki.multitheftauto.com/wiki/GetPlayerName

https://wiki.multitheftauto.com/wiki/DxDrawText

Link to comment

example

local screenWidth, screenHeight = guiGetScreenSize() 
  
function createText ( ) 
    local money = getPlayerMoney(localPlayer) 
    dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1, "pricedown" ) 
end 
addEventHandler("onClientRender",root, createText) 

Link to comment

Thx Tapl For The example i well study it :D

i Made This see

local screenWidth, screenHeight = guiGetScreenSize() 
  
function M ( ) 
local money = getPlayerMoney(localPlayer) 
local ping = getPlayerPing(localPlayer) 
 dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1, "default-bold" ) 
 dxDrawText( "Your Ping: "..tostring(ping), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 0, 255 ), 1, "default-bold" ) 
end 
addEventHandler("onClientRender",root, createText) 

is it Right?

Link to comment
local screenWidth, screenHeight = guiGetScreenSize() 
  
function M ( ) 
local money = getPlayerMoney(localPlayer) 
local ping = getPlayerPing(localPlayer) 
 dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1, "default-bold" ) 
 dxDrawText( "Your Ping: "..tostring(ping), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 0, 255 ), 1, "default-bold" ) 
end 
addEventHandler("onClientRender",root, M) 

Link to comment

Can't you edit it?

Next time, look at the function's wiki page.

local screenWidth, screenHeight = guiGetScreenSize() 
  
function M ( ) 
local money = getPlayerMoney(localPlayer) 
local ping = getPlayerPing(localPlayer) 
 dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 2, "default-bold" ) 
 dxDrawText( "Your Ping: "..tostring(ping), 44, screenHeight-55, screenWidth, screenHeight, tocolor ( 255, 255, 0, 255 ), 2, "default-bold" ) 
end 
addEventHandler("onClientRender",root, M) 

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