Snakegold Posted July 25, 2018 Posted July 25, 2018 (edited) Hey guys how to add palyerColor and playerName to dxDrawText ? i tried this codes but not working function text (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) etc... .... and here is the dxDrawText dxDrawText(""..name.." text", r, g, b, screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) also i removed the " playerColor r, g, b, " i got this msg: ERROR: attempt to concatenate local 'name' (a boolean value) Edited July 25, 2018 by Snakegold
Tommy. Posted July 25, 2018 Posted July 25, 2018 local gPName = getPlayerName(getLocalPlayer()) dxDrawText(gPName.." text", screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, true, false) DID I HELP YOU? ________________________________________________________________________ ム MY STEAM ________________________________________________________________________ MY SITE www.tommy.br.com
Snakegold Posted July 25, 2018 Author Posted July 25, 2018 (edited) wht about player name color ? Edited July 25, 2018 by Snakegold
Dimos7 Posted July 25, 2018 Posted July 25, 2018 local name = getPlayerName(localPlayer) local r, g, b = getPlayerNametagColor(localPlayer) dxDrawText(""..name.." text", screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(r , g , b , 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false)
Snakegold Posted July 25, 2018 Author Posted July 25, 2018 Bro why dxDrawtext appears only to me not everyone????
Moderators IIYAMA Posted July 25, 2018 Moderators Posted July 25, 2018 Just now, Snakegold said: Bro why dxDrawtext appears only to me not everyone???? Because each computer is processing the same code. And localPlayer/getLocalPlayer() is used to get the player that is being controlled. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Snakegold Posted July 25, 2018 Author Posted July 25, 2018 i want when i do the command or someone do it , everyone can see it , how?
Moderators IIYAMA Posted July 25, 2018 Moderators Posted July 25, 2018 2 minutes ago, Snakegold said: i want when i do the command or someone do it , everyone can see it , how? Learn first what a element, table and a loop is. After that I will provide you with examples, because else you will not understand the code. https://wiki.multitheftauto.com/wiki/Element https://www.lua.org/pil/2.5.html https://www.lua.org/pil/4.3.5.html Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Snakegold Posted July 25, 2018 Author Posted July 25, 2018 (edited) i typed the code so i know it Edited July 25, 2018 by Snakegold
Moderators IIYAMA Posted July 25, 2018 Moderators Posted July 25, 2018 If you say so, then ok here you are: local players = getElementsByType ("player", root, true) for i=1, #players do local player = players[i] -- do your thing end Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now