Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. function WarningSigns:load(savegame)
  2.  
  3. self.playerCallback = SpecializationUtil.callSpecializationsFunction("playerCallback");
  4. self.setSign = SpecializationUtil.callSpecializationsFunction("setSign");
  5.  
  6. self.ws = {};
  7.  
  8. local i=0;
  9. while true do
  10. local str = getXMLString(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#index", i));
  11. if str == nil then
  12. break;
  13. end;
  14. local node = Utils.indexToObject(self.components, str);
  15. if node == nil then
  16. print("[Error::WarningSigns] node for "..tostring(str).." does not exist");
  17. break;
  18. end;
  19. local trigger = Utils.indexToObject( self.components, getXMLString(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#trigger", i)) );
  20. if trigger == nil then
  21. print("[Error::WarningSigns] node is OK, but trigger could not be located. Check line "..tostring(i+1).." in your vehicle.xml");
  22. end;
  23. local isVis = getXMLBool(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#isVisible", i))
  24. self.ws[i+1] = {};
  25. self.ws[i+1].node = node;
  26. self.ws[i+1].trigger = trigger;
  27. self.ws[i+1].isVis = isVis;
  28. self.ws[i+1].plIR = false;
  29.  
  30. addTrigger( trigger, "playerCallback", self );
  31. i = i + 1;
  32. end;
  33.  
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement