CheckPlayerCamera

From ZDoom Wiki

Jump to: navigation, search

int CheckPlayerCamera (int player)
(development version only)

Usage

Returns the TID of the camera that the specified player is currently viewing. If no camera is being viewed (the player is currently looking through their own viewpoint), then this returns -1.

Examples

This script deactivates all actors with a TID of 60 while the player is using a camera. This could be used to prevent enemies from attacking the player while he is doing so.

script 10 ENTER
{
   while (!CheckPlayerCamera(PlayerNumber())) Delay(1);

   Thing_Deactivate(60);

   while (CheckPlayerCamera(PlayerNumber())) Delay(1);

   Thing_Activate(60);

   Restart;
}
Personal tools