IIIIlllllIII Posted October 2, 2011 Share Posted October 2, 2011 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
E-mail Posted October 2, 2011 Share Posted October 2, 2011 did you add the script to admin group? Link to comment
IIIIlllllIII Posted October 2, 2011 Author Share Posted October 2, 2011 did you add the script to admin group? الله يهديك ياديف بوينت مسوي فاهم خخخخخخخ ارحب yes sure i added the script on admin group Link to comment
E-mail Posted October 2, 2011 Share Posted October 2, 2011 use Label or dxdraw function https://wiki.multitheftauto.com/wiki/GuiCreateLabel Link to comment
IIIIlllllIII Posted October 2, 2011 Author Share Posted October 2, 2011 use Label or dxdraw functionhttps://wiki.multitheftauto.com/wiki/GuiCreateLabel make sure you helped me you dont know how to script work so if you not sure pleez dont give me wrong script and make sure you give me the code here thanks Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 lol? you forgot the old topic or what? viewtopic.php?f=91&t=36022&p=371780#p371776 Link to comment
BinSlayer1 Posted October 2, 2011 Share Posted October 2, 2011 get the element data BEFORE you use guiSetText Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 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 Link to comment
IIIIlllllIII Posted October 2, 2011 Author Share Posted October 2, 2011 he won't learn anything, i was fixed his code in other topic from 11 dayshe never look at the code i was given to him! and now he ask help to same thing yes that is true you fixed before the code is working great and now when i test it i have error with it Link to comment
^Dev-PoinT^ Posted October 2, 2011 Share Posted October 2, 2011 use /debugscript 3 and tell us what is the errors Link to comment
BinSlayer1 Posted October 2, 2011 Share Posted October 2, 2011 before the code is working great and now when i test it i have error with it get the element data BEFORE you use guiSetText Link to comment
Cadu12 Posted October 2, 2011 Share Posted October 2, 2011 triggerClientEvent triggerServerEvent Use a trigger. Link to comment
Al3grab Posted October 2, 2011 Share Posted October 2, 2011 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
BinSlayer1 Posted October 2, 2011 Share Posted October 2, 2011 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
Cadu12 Posted October 2, 2011 Share Posted October 2, 2011 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
mjau Posted October 2, 2011 Share Posted October 2, 2011 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 Oh btw better english would do you good too Link to comment
Al3grab Posted October 3, 2011 Share Posted October 3, 2011 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 Link to comment
Fentas Posted October 3, 2011 Share Posted October 3, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now