Jump to content

drawData exporting [Help]


Sande

Recommended Posts

Can someone make this code work, im starter and i dont know how make it work.

Thaanks.

addEventHandler ( "onClientPlayerChangeNick", root, 
function ( oldNick, newNick ) 
nickData = "* " .. oldNick .. " is now known as " .. newNick .. "." 
exports["drawData"]:outputDraw ( nickData, 255, 100, 100, false ) 
end 
) 
addEventHandler ( "onClientPlayerJoin", root, 
function ( thePlayer ) 
onlineData = "* " .. Online Players: .. getElementsByType('player')) .. "." 
exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) 
end 
) 
addEventHandler ( "onClientPlayerQuit", root, 
function ( thePlayer ) 
onlineData = "* " .. Online Players: .. getElementsByType('player')) .. "." 
exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) 
end 
) 

Link to comment
addEventHandler ( "onClientPlayerChangeNick", root, 
    function ( oldNick, newNick ) 
            local nickData = "* " .. oldNick .. " is now known as " .. newNick .. "." 
            exports["drawData"]:outputDraw ( nickData, 255, 100, 100, false ) 
end 
) 
addEventHandler ( "onClientPlayerJoin", root, 
    function (  ) 
        local onlineData = "* Online Players: "..#getElementsByType( "player" ) .. "." 
        exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) 
end 
) 
addEventHandler ( "onClientPlayerQuit", root, 
    function (  ) 
        local onlineData = "* Online Players: "..#getElementsByType( "player" ) .. "." 
        exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) 
  
end 
) 

Try this client side .

Link to comment

Server:

  
addEventHandler("onPlayerLogin", root, 
    function() 
        triggerClientEvent("loginDraw", source) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        triggerClientEvent("logoutDraw", source) 
    end 
) 
  

Client:

  
addEvent("loginDraw", true) 
addEventHandler("loginDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged in!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  
addEvent("logoutDraw", true) 
addEventHandler("logoutDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged out!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  

Link to comment
Server:
  
addEventHandler("onPlayerLogin", root, 
    function() 
        triggerClientEvent("loginDraw", source) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        triggerClientEvent("logoutDraw", source) 
    end 
) 
  

Client:

  
addEvent("loginDraw", true) 
addEventHandler("loginDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged in!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  
addEvent("logoutDraw", true) 
addEventHandler("logoutDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged out!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  

bool triggerClientEvent ( [element sendTo=getRootElement()], string name, element theElement, [arguments...] ) 

Link to comment
Server:
  
addEventHandler("onPlayerLogin", root, 
    function() 
        triggerClientEvent("loginDraw", source) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        triggerClientEvent("logoutDraw", source) 
    end 
) 
  

Client:

  
addEvent("loginDraw", true) 
addEventHandler("loginDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged in!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  
addEvent("logoutDraw", true) 
addEventHandler("logoutDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged out!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  

bool triggerClientEvent ( [element sendTo=getRootElement()], string name, element theElement, [arguments...] ) 

What? "sendTo" argument is optional. And I'm sure he wants to show text to all players.

Link to comment
Server:
  
addEventHandler("onPlayerLogin", root, 
    function() 
        triggerClientEvent("loginDraw", source) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        triggerClientEvent("logoutDraw", source) 
    end 
) 
  

Client:

  
addEvent("loginDraw", true) 
addEventHandler("loginDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged in!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  
addEvent("logoutDraw", true) 
addEventHandler("logoutDraw", root, 
    function() 
        local data = getPlayerName(source).." has logged out!" 
        exports["drawData"]:outputDraw(data, 255, 100, 100, false) 
    end 
) 
  

bool triggerClientEvent ( [element sendTo=getRootElement()], string name, element theElement, [arguments...] ) 

What? "sendTo" argument is optional. And I'm sure he wants to show text to all players.

Yes because that if you don't set the first argument to source it will be set to root automatically.

P.S : Sorry i was thinking he want it to the player only.

Edited by Guest
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...