Jump to content

attempt to concatenate a boolean value [ getPlayerName ]


Aristates

Recommended Posts

Posted

Where Problem. getPlayerName(source) don't getPlayerName(localPlayer)

    function directxName() 
    des = getPlayerName(source).." " 
        dxDrawText(des, (screenW * 0.0500) + 1, (screenH * 0.4700) + 1, (screenW * 0.2175) + 1, (screenH * 0.4950) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false) 
        dxDrawText(des, screenW * 0.0500, screenH * 0.4700, screenW * 0.2175, screenH * 0.4950, tocolor(254, 254, 254, 254), 1.00, "default-bold", "center", "center", false, false, false, true, false) 
        dxDrawImage(screenW * 0.0175, screenH * 0.4633, screenW * 0.0275, screenH * 0.0317, "data/img/jn.png", 0, 0, 0, tocolor(92, 231, 0, 168), false) 
    end 

Posted
    function directxName() 
    des = getPlayerName(getLocalPlayer()).." " 
        dxDrawText(des, (screenW * 0.0500) + 1, (screenH * 0.4700) + 1, (screenW * 0.2175) + 1, (screenH * 0.4950) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false) 
        dxDrawText(des, screenW * 0.0500, screenH * 0.4700, screenW * 0.2175, screenH * 0.4950, tocolor(254, 254, 254, 254), 1.00, "default-bold", "center", "center", false, false, false, true, false) 
        dxDrawImage(screenW * 0.0175, screenH * 0.4633, screenW * 0.0275, screenH * 0.0317, "data/img/jn.png", 0, 0, 0, tocolor(92, 231, 0, 168), false) 
    end 

The source is nil in client, Use getLocalPlayer() and test this code.

Posted

don't localplayer. my full new code in guiSetText value don't work.

addEvent("set", true) 
addEventHandler("set", root, function(değer) 
guiSetText(labels, tostring(değer)) 
end 
) 

function getPlayerNames() 
player = getPlayerName(source) 
triggerClientEvent("set", resourceRoot, player) 
end 
addEventHandler("onPlayerJoin", root, getPlayerNames) 
  

Posted

-- # Server Side : 
  
function getPlayerNames (    ) 
triggerClientEvent ( "set", source, getPlayerName ( source ) ) 
end 
  
addEventHandler ( "onPlayerJoin", root, getPlayerNames ) 
  
-- # Client Side : 
  
addEvent ( "set", true ) 
addEventHandler ( "set", root, function ( p ) 
guiSetText ( labels, tostring ( p ) ) 
end 
) 

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