Lol, and when i join the game, the counter does not appear jut when i logged in, and got this warning @ Bad argument @ 'dxDrawText' [Expected string at argument 1, got nil] How to fix this? ..:s
This is the client code:
local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1024), (screenH/768)
local size = y*1.50
function drawText()
local playerCoins = getPlayerCoin(getLocalPlayer());
-- local gPlayerCoins = string.format("%08d", playerCoins);
dxDrawRectangle(screenW * 0.6972, screenH * 0.0711, screenW * 0.1500, screenH * 0.0256, tocolor(0, 0, 0, 170), false)
dxDrawText("Coin:", screenW * 0.7000, screenH * 0.0711, screenW * 0.7431, screenH * 0.0967, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", false, false, false, false, false)
dxDrawText(playerCoins, screenW * 0.7431, screenH * 0.0711, screenW * 0.8472, screenH * 0.0967, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end
addEventHandler("onClientRender", root, drawText)
function getPlayerCoin()
local data = getElementData(getLocalPlayer(), "moneycoins");
thePoints = tonumber(data);
return thePoints
end
fileDelete("c_client.lua")
And yeah, #WeAreTheVR