ExampleModule.tscript 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. function ExampleModule::onCreate(%this)
  2. {
  3. }
  4. function ExampleModule::onDestroy(%this)
  5. {
  6. }
  7. //This is called when the server is initially set up by the game application
  8. function ExampleModule::initServer(%this)
  9. {
  10. %this.queueExec("./scripts/shared/ExampleGameMode");
  11. }
  12. //This is called when the server is created for an actual game/map to be played
  13. function ExampleModule::onCreateGameServer(%this)
  14. {
  15. }
  16. //This is called when the server is shut down due to the game/map being exited
  17. function ExampleModule::onDestroyGameServer(%this)
  18. {
  19. }
  20. //This is called when the client is initially set up by the game application
  21. function ExampleModule::initClient(%this)
  22. {
  23. %this.queueExec("./scripts/client/inputCommands");
  24. //client scripts
  25. exec("./scripts/client/defaultkeybinds");
  26. %prefPath = getPrefpath();
  27. if(isScriptFile(%prefPath @ "/keybinds"))
  28. exec(%prefPath @ "/keybinds");
  29. %this.queueExec("./scripts/shared/ExampleGameMode");
  30. }
  31. //This is called when a client connects to a server
  32. function ExampleModule::onCreateClientConnection(%this)
  33. {
  34. ExampleMovemap.push();
  35. }
  36. //This is called when a client disconnects from a server
  37. function ExampleModule::onDestroyClientConnection(%this)
  38. {
  39. }