Jump to content

fix this =========== small problem===^_^


Recommended Posts

hi

i make shop and i have a small problem

i want show ip and serial and ping on info tab

i try to make it but the script give me nil or error

like

your serial : nil

your ping : nil

your ip : nil

pleez fix this

this code client said

  
  
  
tab1 = guiCreateTab("Info",tabPanel) 
  
playerPingLabel = guiCreateLabel(8,165,320,18,"Your Ping:",false,tab1) 
guiLabelSetColor(playerPingLabel,255,255,0) 
playerIPLabel = guiCreateLabel(8,190,320,18,"Your IP: ",false,tab1) 
guiLabelSetColor(playerIPLabel,255,255,0) 
playerSrLabel = guiCreateLabel(8,211,320,18,"Your Serial: ",false,tab1) 
guiLabelSetColor(playerSrLabel,255,255,0) 
  
  
  
-------------------------------------------------------------------- 
  
  
  
    guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. "  " ,true,tab1) 
  
  
    guiSetText ( playerPingLabel, "Your Ping: " ..tostring(ping).. "  " ,true,tab1) 
  
  
    guiSetText ( playerIPLabel, "Your ip: " ..tostring(ips).. "  " ,true,tab1) 
  
    local ping = getElementData ( getLocalPlayer(), "ping" ,true) 
    local ips = getElementData ( getLocalPlayer(), "ips" ,true) 
    local srs = getElementData ( getLocalPlayer(), "srs" ,true) 
  
  
  
  
  
  
  

server sid

  
  
  
  
  
  
addEventHandler("onPlayerJoin",root, 
function() 
ping = getPlayerPing(source) 
money = getPlayerMoney(source) 
ips = getPlayerIP(source) 
srs = getPlayerSerial(source) 
  
setElementData(source,"ping",ping) 
setElementData(source,"money",money) 
  
setElementData(source,"ips",ips) 
setElementData(source,"srs",srs) 
  
end ) 
  
  
  
  
  

Link to comment
  
tab1 = guiCreateTab("Info",tabPanel) 
  
playerPingLabel = guiCreateLabel(8,165,320,18,"Your Ping:",false,tab1) 
guiLabelSetColor(playerPingLabel,255,255,0) 
playerIPLabel = guiCreateLabel(8,190,320,18,"Your IP: ",false,tab1) 
guiLabelSetColor(playerIPLabel,255,255,0) 
playerSrLabel = guiCreateLabel(8,211,320,18,"Your Serial: ",false,tab1) 
guiLabelSetColor(playerSrLabel,255,255,0) 
  
  
  
-------------------------------------------------------------------- 
    guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. "  " ,true,tab1) 
    guiSetText ( playerPingLabel, "Your Ping: " ..tostring(ping).. "  " ,true,tab1) 
    guiSetText ( playerIPLabel, "Your ip: " ..tostring(ips).. "  " ,true,tab1) 
    local ping = getElementData ( getLocalPlayer(), "ping") 
    local ips = getElementData ( getLocalPlayer(), "ips") 
    local srs = getElementData ( getLocalPlayer(), "srs") 
  

  
addEventHandler("onPlayerJoin",root, 
function() 
setElementData(source,"ping",getPlayerPing(source)) 
setElementData(source,"money",getPlayerMoney(source)) 
  
setElementData(source,"ips",getPlayerIP(source)) 
setElementData(source,"srs",getPlayerSerial(source)) 
  
end ) 
  

Link to comment
  
    guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. "  " ,true,tab1) 
    guiSetText ( playerPingLabel, "Your Ping: " ..tostring(ping).. "  " ,true,tab1) 
    guiSetText ( playerIPLabel, "Your ip: " ..tostring(ips).. "  " ,true,tab1) 
    local ping = getElementData ( getLocalPlayer(), "ping") 
    local ips = getElementData ( getLocalPlayer(), "ips") 
    local srs = getElementData ( getLocalPlayer(), "srs") 
  

But seriously, how can you guiSetText something you didn't define?

this: guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. " " ,true,tab1)

becomes: guiSetText ( playerSrLabel, "Your serial: " .."nil".. " " ,true,tab1)

instead of: guiSetText ( playerSrLabel, "Your serial: " .."1hdfjsfdsfdsfdsfds".. " " ,true,tab1)

because: local srs = getElementData ( getLocalPlayer(), "srs") --is defined after the text is set.

It's probably the 3rd time I'm saying this and get ignored lol

Link to comment
  
tab1 = guiCreateTab("Info",tabPanel) 
  
playerPingLabel = guiCreateLabel(8,165,320,18,"Your Ping:",false,tab1) 
guiLabelSetColor(playerPingLabel,255,255,0) 
playerIPLabel = guiCreateLabel(8,190,320,18,"Your IP: ",false,tab1) 
guiLabelSetColor(playerIPLabel,255,255,0) 
playerSrLabel = guiCreateLabel(8,211,320,18,"Your Serial: ",false,tab1) 
guiLabelSetColor(playerSrLabel,255,255,0) 
  
  
  
-------------------------------------------------------------------- 
    local ping = getElementData ( getLocalPlayer(), "ping") 
    local ips = getElementData ( getLocalPlayer(), "ips") 
    local srs = getElementData ( getLocalPlayer(), "srs") 
    guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. "  " ,true,tab1) 
    guiSetText ( playerPingLabel, "Your Ping: " ..tostring(ping).. "  " ,true,tab1) 
    guiSetText ( playerIPLabel, "Your ip: " ..tostring(ips).. "  " ,true,tab1) 
  

Try this.

edit: agree with BinSlayer1

Link to comment
  
    guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. "  " ,true,tab1) 
    guiSetText ( playerPingLabel, "Your Ping: " ..tostring(ping).. "  " ,true,tab1) 
    guiSetText ( playerIPLabel, "Your ip: " ..tostring(ips).. "  " ,true,tab1) 
    local ping = getElementData ( getLocalPlayer(), "ping") 
    local ips = getElementData ( getLocalPlayer(), "ips") 
    local srs = getElementData ( getLocalPlayer(), "srs") 
  

But seriously, how can you guiSetText something you didn't define?

this: guiSetText ( playerSrLabel, "Your serial: " ..tostring(srs).. " " ,true,tab1)

becomes: guiSetText ( playerSrLabel, "Your serial: " .."nil".. " " ,true,tab1)

instead of: guiSetText ( playerSrLabel, "Your serial: " .."1hdfjsfdsfdsfdsfds".. " " ,true,tab1)

because: local srs = getElementData ( getLocalPlayer(), "srs") --is defined after the text is set.

It's probably the 3rd time I'm saying this and get ignored lol

well , i think because the code he posted is mine , and he stole it :D

Link to comment

No offence.. but I really dont know, why the hell you keep helping this greedy and lazy person. He act like he is the best and he owns you.. Anyway.. He published this "shop" (very crap and buggy resource) 3 times on the community, for unknown reason.. and look at his attitude.. "and make sure you give me the code here", are we your slave's, so we must give you the code working for shure or what? I am sorry for the offtopic, but I cant believe you keep helping him. Go and learn god damn English first, and then start learning LUA by yourself.. thats my opinion.

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