K4stic Posted March 12, 2013 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 Giving a Fuck? Nope, That isn't in My Skill Set
K4stic Posted March 12, 2013 Author 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 Giving a Fuck? Nope, That isn't in My Skill Set
PaiN^ Posted March 12, 2013 Posted March 12, 2013 What do you mean ' updatable ' ? " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Jaysds1 Posted March 12, 2013 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author 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 Giving a Fuck? Nope, That isn't in My Skill Set
PaiN^ Posted March 12, 2013 Posted March 12, 2013 setTimer ?? " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
K4stic Posted March 12, 2013 Author Posted March 12, 2013 i know the finction but how make it -.- Giving a Fuck? Nope, That isn't in My Skill Set
PaiN^ Posted March 12, 2013 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 . " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Jaysds1 Posted March 12, 2013 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! My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author Posted March 12, 2013 now it show me every 5 sec the window i need to updated only text then the gui opening -.- Giving a Fuck? Nope, That isn't in My Skill Set
Jaysds1 Posted March 12, 2013 Posted March 12, 2013 try my script! My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author Posted March 12, 2013 no work Giving a Fuck? Nope, That isn't in My Skill Set
Jaysds1 Posted March 12, 2013 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! My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
PaiN^ Posted March 12, 2013 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 . " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Jaysds1 Posted March 12, 2013 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author 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 Giving a Fuck? Nope, That isn't in My Skill Set
Jaysds1 Posted March 12, 2013 Posted March 12, 2013 Do you want when a player chooses another player by name to see their data(kills,deaths, etc)? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author Posted March 12, 2013 its for same gui but to refresh combobos to sent money Giving a Fuck? Nope, That isn't in My Skill Set
Jaysds1 Posted March 12, 2013 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author Posted March 12, 2013 it's doublicate the player names every open of gui -.- Giving a Fuck? Nope, That isn't in My Skill Set
PaiN^ Posted March 12, 2013 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 " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Jaysds1 Posted March 12, 2013 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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
K4stic Posted March 12, 2013 Author Posted March 12, 2013 thx you Jaysds1 now it's work Giving a Fuck? Nope, That isn't in My Skill Set
Jaysds1 Posted March 12, 2013 Posted March 12, 2013 np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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