NeuralStunner

ACS: Resurrect-Friendly Polling

Aug 22nd, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #Define Player_0_TID 32000
  2.  
  3. Script "Player_Enter" Enter
  4. {
  5. // Not needed or desired in TitleMaps.
  6. If (GameType() == Game_Title_Map) Terminate;
  7.  
  8. // Which Player?
  9. Int ThisPlayer = PlayerNumber();
  10. // Cancel if somehow called by a non-Player.
  11. If ((ThisPlayer < 0) || (ThisPlayer >= 32)) Terminate;
  12.  
  13. // Unique Player TID. Make sure nothing else in the game has it!
  14. Int ThisTID = ThisPlayer + Player_0_TID;
  15. Thing_ChangeTID (ThisTID, 0);
  16. Thing_ChangeTID (0, ThisTID);
  17.  
  18. While (True)
  19. {
  20. // They've left this body?
  21. If (ActivatorTID() == 0) Terminate;
  22. // Abort if they're gone.
  23. If (!PlayerInGame(ThisPlayer)) Terminate;
  24.  
  25. // Other stuff goes here.
  26.  
  27. Delay (Const:1);
  28. }
  29. }
  30.  
  31. Script "Player_Respawn" Respawn
  32. {
  33. // Let's just re-call the main script.
  34. ACS_NamedExecuteAlways ("Player_Enter", 0);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment