fcafe6b428
Added some base functions for working with modules. It's not tested, but it compiles. CVARs are not created yet. Implemented volume events. Function VolUpdatePlayerChanges with help from VolGetPlayerStates detects if a player leave or enter a volume between main timer intervals. This solution is not final and might be expensive. Needs to be optimized later!
71 lines
1.5 KiB
SourcePawn
71 lines
1.5 KiB
SourcePawn
/*
|
|
* ============================================================================
|
|
*
|
|
* Zombie:Reloaded
|
|
*
|
|
* File: volevents.inc
|
|
* Type: Module
|
|
* Description: Handles volumetric feature events.
|
|
*
|
|
* ============================================================================
|
|
*/
|
|
|
|
/**
|
|
* Called when a player enters a volume.
|
|
*
|
|
* @param client The client index.
|
|
* @param volumeIndex The volume index.
|
|
*/
|
|
VolOnPlayerEnter(client, volumeIndex)
|
|
{
|
|
// TODO: Check if volfeatures is enabled first.
|
|
|
|
// Forward event to features.
|
|
// VolAnticampStart(client, volume);
|
|
}
|
|
|
|
/**
|
|
* Called when a player leaves a volume.
|
|
*
|
|
* @param client The client index.
|
|
* @param volumeIndex The volume index.
|
|
*/
|
|
VolOnPlayerLeave(client, volumeIndex)
|
|
{
|
|
// TODO: Check if volfeatures is enabled first.
|
|
|
|
// Forward event to features.
|
|
// VolAnticampStop(client, volume);
|
|
}
|
|
|
|
/**
|
|
* Called when a player spawned. Used for initializing player data.
|
|
*
|
|
* @param client The client index.
|
|
*/
|
|
VolOnPlayerSpawn(client)
|
|
{
|
|
VolUpdatePlayerLocation(client);
|
|
}
|
|
|
|
/**
|
|
* Called when the round starts. Main enable event for volumetric features.
|
|
*/
|
|
VolOnRoundStart()
|
|
{
|
|
// Start main timer.
|
|
VolStartUpdateTimer();
|
|
}
|
|
|
|
/**
|
|
* Called when the round ends. Main disable event for volumetric features.
|
|
*/
|
|
VolOnRoundEnd()
|
|
{
|
|
// Stop main timer.
|
|
VolStopUpdateTimer();
|
|
|
|
// Forward stop event to features.
|
|
// VolAnticampStop();
|
|
}
|