Guest User

Untitled

a guest
Dec 6th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. local xmlFile
  2. local tagStatus
  3.  
  4. function onTagResourceStart()
  5. xmlFile = xmlLoadFile("allianceOptions.xml")
  6. if (not xmlFile) then
  7. xmlFile = xmlCreateFile("allianceOptions.xml", "allianceOptions.xml")
  8. xmlNodeSetAttribute(xmlFile, "greenTagsEnabled", "false")
  9. xmlSaveFile(xmlFile)
  10. end
  11. tagStatus = (xmlNodeGetAttribute(xmlFile, "greenTagsEnabled") == "true")
  12. guiCheckBoxSetSelected(GUI_Checkbox_AllianceTags, tagStatus)
  13. end
  14. addEventHandler("onClientResourceStart", resourceRoot, onTagResourceStart)
  15.  
  16. function toggleTags()
  17. tagStatus = guiCheckBoxGetSelected(GUI_Checkbox_AllianceTags)
  18. xmlNodeSetAttribute(xmlFile, "greenTagsEnabled", tostring(tagStatus))
  19. xmlSaveFile(xmlFile)
  20. refreshPlayerTags()
  21. end
  22. addEventHandler("onClientGUIClick", GUI_Checkbox_AllianceTags, toggleTags, false)
Add Comment
Please, Sign In to add comment