Jump to content

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


Recommended Posts

Posted

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 ) 
  
  
  
  
  

Posted

he won't learn anything, i was fixed his code in other topic from 11 days

he never look at the code i was given to him!

and now he ask help to same thing :?

Posted
he won't learn anything, i was fixed his code in other topic from 11 days

he never look at the code i was given to him!

and now he ask help to same thing :?

:lol: yes that is true

you fixed

before the code is working great

and now when i test it i have error with it :|

Posted
  
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 ) 
  

Posted
  
    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

Posted
  
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

Posted

MOJRM Start Learning and reading the help you get dont just copy and paste or we wont help you more if you keep asking and never learn just a tip :D

Oh btw better english would do you good too :D

Posted
  
    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

Posted

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.

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