K4stic Posted March 12, 2013 Share Posted March 12, 2013 how i can updatable that items local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup,false) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer()),false) guiSetText(label2,"Your name: $"..tostring(getmoney),false) guiSetText(label3,"Your Serial is: "..tostring(getserial),false) guiSetText(label4,"Your Total Kills: "..tostring(totalkills),false) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths),false) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths),false) end end --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 Community Pls help me i need make it updatable that items because i must now restart it all time the resource Link to comment
PaiN^ Posted March 12, 2013 Share Posted March 12, 2013 What do you mean ' updatable ' ? Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 (edited) How do you want this to update? What do you mean ' updatable ' ? He wants the variables at the top to be updated after such and such time so, players could see there's new scores. Edited March 12, 2013 by Guest Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 then in game i charge to my self the Occupation the text no charget or then i kill someone it's not update the Total Kills Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 i know the finction but how make it -.- Link to comment
PaiN^ Posted March 12, 2013 Share Posted March 12, 2013 local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"") guiSetText(label1,"") guiSetText(label2,"") guiSetText(label3,"") guiSetText(label4,"") guiSetText(label5,"") guiSetText(label6,"") elseif (visableornot == false) then guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your money: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) end end setTimer( menuShow, 5000, 0 ) --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end B.T.W : The function guiSetTextdosn't have a third argument, So you don't need to but true or false . Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 try this: local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 setTimer(function() getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 end,10000,0) function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) end end --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end @Pain - That would only update the gui which is not needed, you would need to update the variables for the element data at the top! Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 now it show me every 5 sec the window i need to updated only text then the gui opening -.- Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 You said you want the data to be updated in the GUI right? try this: local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) end end --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end This will be updated when the gui is opened! Link to comment
PaiN^ Posted March 12, 2013 Share Posted March 12, 2013 You said you want the data to be updated in the GUI right?try this: local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) end end --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end This will be updated when the gui is opened! The locals in the top of the code are not required, Unless you are using theme in another function . Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 The locals in the top of the code are not required, Unless you are using theme in another function . He might be using it for other things in the code, because this looks like a little part of the code Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 ok thx but how i can now update this? for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 Do you want when a player chooses another player by name to see their data(kills,deaths, etc)? Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 its for same gui but to refresh combobos to sent money Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 try this: local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end end end Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 it's doublicate the player names every open of gui -.- Link to comment
PaiN^ Posted March 12, 2013 Share Posted March 12, 2013 local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) for id, player in ipairs(getElementsByType("player")) do guiComboBoxClear( guicomboBox ) guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end end end Link to comment
Jaysds1 Posted March 12, 2013 Share Posted March 12, 2013 @pain - That would still remove the players you are adding into the gui combo box try this: local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then getoccup = getElementData( getLocalPlayer(), "Occupation" ) getmoney = getPlayerMoney(getLocalPlayer()) getserial = getPlayerSerial(getLocalPlayer()) totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer())) guiSetText(label2,"Your name: $"..tostring(getmoney)) guiSetText(label3,"Your Serial is: "..tostring(getserial)) guiSetText(label4,"Your Total Kills: "..tostring(totalkills)) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths)) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths)) guiComboBoxClear( guicomboBox ) --clears before adding every player to the combo box for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end end end Link to comment
K4stic Posted March 12, 2013 Author Share Posted March 12, 2013 thx you Jaysds1 now it's work 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