added a new forward for OnServerActivate
included timers from sourcemod.inc --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40649
This commit is contained in:
parent
3250b1d2b7
commit
88eae4ad1e
@ -60,6 +60,7 @@ void PlayerManager::OnSourceModAllInitialized()
|
|||||||
m_clcommand = g_Forwards.CreateForward("OnClientCommand", ET_Hook, 2, NULL, Param_Cell, Param_Cell);
|
m_clcommand = g_Forwards.CreateForward("OnClientCommand", ET_Hook, 2, NULL, Param_Cell, Param_Cell);
|
||||||
m_clinfochanged = g_Forwards.CreateForward("OnClientSettingsChanged", ET_Ignore, 1, p2);
|
m_clinfochanged = g_Forwards.CreateForward("OnClientSettingsChanged", ET_Ignore, 1, p2);
|
||||||
m_clauth = g_Forwards.CreateForward("OnClientAuthorized", ET_Ignore, 2, NULL, Param_Cell, Param_String);
|
m_clauth = g_Forwards.CreateForward("OnClientAuthorized", ET_Ignore, 2, NULL, Param_Cell, Param_String);
|
||||||
|
m_onActivate = g_Forwards.CreateForward("OnServerLoad", ET_Ignore, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerManager::OnSourceModShutdown()
|
void PlayerManager::OnSourceModShutdown()
|
||||||
@ -80,6 +81,7 @@ void PlayerManager::OnSourceModShutdown()
|
|||||||
g_Forwards.ReleaseForward(m_clcommand);
|
g_Forwards.ReleaseForward(m_clcommand);
|
||||||
g_Forwards.ReleaseForward(m_clinfochanged);
|
g_Forwards.ReleaseForward(m_clinfochanged);
|
||||||
g_Forwards.ReleaseForward(m_clauth);
|
g_Forwards.ReleaseForward(m_clauth);
|
||||||
|
g_Forwards.ReleaseForward(m_onActivate);
|
||||||
|
|
||||||
delete [] m_Players;
|
delete [] m_Players;
|
||||||
}
|
}
|
||||||
@ -97,6 +99,7 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
|
|||||||
|
|
||||||
memset(m_AuthQueue, 0, sizeof(unsigned int) * (m_maxClients + 1));
|
memset(m_AuthQueue, 0, sizeof(unsigned int) * (m_maxClients + 1));
|
||||||
}
|
}
|
||||||
|
m_onActivate->Execute(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerManager::RunAuthChecks()
|
void PlayerManager::RunAuthChecks()
|
||||||
|
@ -111,6 +111,7 @@ private:
|
|||||||
IForward *m_clcommand;
|
IForward *m_clcommand;
|
||||||
IForward *m_clinfochanged;
|
IForward *m_clinfochanged;
|
||||||
IForward *m_clauth;
|
IForward *m_clauth;
|
||||||
|
IForward *m_onActivate;
|
||||||
CPlayer *m_Players;
|
CPlayer *m_Players;
|
||||||
int m_maxClients;
|
int m_maxClients;
|
||||||
int m_PlayerCount;
|
int m_PlayerCount;
|
||||||
|
@ -43,6 +43,7 @@ struct Plugin
|
|||||||
#include <usermessages>
|
#include <usermessages>
|
||||||
#include <events>
|
#include <events>
|
||||||
#include <functions>
|
#include <functions>
|
||||||
|
#include <timers>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare this as a struct in your plugin to expose its information.
|
* Declare this as a struct in your plugin to expose its information.
|
||||||
@ -104,6 +105,13 @@ forward OnPluginPauseChange(bool:pause);
|
|||||||
*/
|
*/
|
||||||
forward OnGameFrame();
|
forward OnGameFrame();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the map is loaded and configs have been parsed.
|
||||||
|
* Note that commands are processed per-frame, and thus config
|
||||||
|
* files may not be fully loaded until a few seconds later.
|
||||||
|
*/
|
||||||
|
forward OnServerLoad();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the calling plugin's Handle.
|
* Returns the calling plugin's Handle.
|
||||||
*
|
*
|
||||||
|
@ -67,7 +67,7 @@ funcenum Timer
|
|||||||
* @param flags Flags to set (such as repeatability or auto-Handle closing).
|
* @param flags Flags to set (such as repeatability or auto-Handle closing).
|
||||||
* @return Handle to the timer object. You do not need to call CloseHandle().
|
* @return Handle to the timer object. You do not need to call CloseHandle().
|
||||||
*/
|
*/
|
||||||
native Handle:CreateTimer(Float:interval, Timer:func, {Handle,_}:value, flags);
|
native Handle:CreateTimer(Float:interval, Timer:func, {Handle,_}:value, flags=0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kills a timer. Use this instead of CloseHandle() if you need more options.
|
* Kills a timer. Use this instead of CloseHandle() if you need more options.
|
||||||
|
Loading…
Reference in New Issue
Block a user