Jump to content

Help (( getPlayerIP ))


manve1

Recommended Posts

server

  
function getIP() 
    local ip = getPlayerIP(source) 
    setElementData(source, "IP", ip) 
end 
addEvent("getIP", true) 
addEventHandler("getIP", root, getIP) 

client

  
triggerServerEvent("getIP", localPlayer) 
local ip = getElementData(localPlayer, "IP") 
guiSetText(label, ip) 
  

Link to comment

How can you make that it would stream in quicker, because when i join, it doesn't change the label to IP :\

CLIENT:

addEventHandler('onClientPlayerJoin', getRootElement(), 
function() 
triggerServerEvent("getIP", localPlayer) 
local ip = getElementData(localPlayer, "IP") 
guiSetText(labelIP2, ip) 
end 
) 

SERVER:

function getIP() 
    local ip = getPlayerIP(source) 
    setElementData(source, "IP", ip) 
end 
addEvent("getIP", true) 
addEventHandler("getIP", root, getIP) 

Link to comment
  • Other Languages Moderators

-- Client Side --

guiSetText(labelIP2, getElementData(localPlayer, "IP")) 

-- Server Side --

addEventHandler("onPlayerJoin", root, 
function() 
     setElementData(source, "IP", getPlayerIP(source)) 
end) 

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