Snakegold Posted July 25, 2018 Share 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 Link to comment
Tommy. Posted July 25, 2018 Share 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) Link to comment
Snakegold Posted July 25, 2018 Author Share Posted July 25, 2018 (edited) wht about player name color ? Edited July 25, 2018 by Snakegold Link to comment
Dimos7 Posted July 25, 2018 Share 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) Link to comment
Snakegold Posted July 25, 2018 Author Share Posted July 25, 2018 Bro why dxDrawtext appears only to me not everyone???? Link to comment
Moderators IIYAMA Posted July 25, 2018 Moderators Share 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. Link to comment
Snakegold Posted July 25, 2018 Author Share Posted July 25, 2018 i want when i do the command or someone do it , everyone can see it , how? Link to comment
Moderators IIYAMA Posted July 25, 2018 Moderators Share 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 Link to comment
Snakegold Posted July 25, 2018 Author Share Posted July 25, 2018 (edited) i typed the code so i know it Edited July 25, 2018 by Snakegold Link to comment
Moderators IIYAMA Posted July 25, 2018 Moderators Share 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 Link to comment
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