amb283 - Renamed IsPlayerInGame() to IsClientInGame()

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40790
This commit is contained in:
Scott Ehlert 2007-05-13 07:48:36 +00:00
parent f7aa15c06c
commit 8a9b5b7d41
2 changed files with 19 additions and 9 deletions

View File

@ -111,7 +111,7 @@ static cell_t sm_GetClientAuthStr(IPluginContext *pCtx, const cell_t *params)
return 1; return 1;
} }
static cell_t sm_IsPlayerConnected(IPluginContext *pCtx, const cell_t *params) static cell_t sm_IsClientConnected(IPluginContext *pCtx, const cell_t *params)
{ {
int index = params[1]; int index = params[1];
if ((index < 1) || (index > g_Players.GetMaxClients())) if ((index < 1) || (index > g_Players.GetMaxClients()))
@ -122,7 +122,7 @@ static cell_t sm_IsPlayerConnected(IPluginContext *pCtx, const cell_t *params)
return (g_Players.GetPlayerByIndex(index)->IsConnected()) ? 1 : 0; return (g_Players.GetPlayerByIndex(index)->IsConnected()) ? 1 : 0;
} }
static cell_t sm_IsPlayerIngame(IPluginContext *pCtx, const cell_t *params) static cell_t sm_IsClientInGame(IPluginContext *pCtx, const cell_t *params)
{ {
int index = params[1]; int index = params[1];
if ((index < 1) || (index > g_Players.GetMaxClients())) if ((index < 1) || (index > g_Players.GetMaxClients()))
@ -133,7 +133,7 @@ static cell_t sm_IsPlayerIngame(IPluginContext *pCtx, const cell_t *params)
return (g_Players.GetPlayerByIndex(index)->IsInGame()) ? 1 : 0; return (g_Players.GetPlayerByIndex(index)->IsInGame()) ? 1 : 0;
} }
static cell_t sm_IsPlayerAuthorized(IPluginContext *pCtx, const cell_t *params) static cell_t sm_IsClientAuthorized(IPluginContext *pCtx, const cell_t *params)
{ {
int index = params[1]; int index = params[1];
if ((index < 1) || (index > g_Players.GetMaxClients())) if ((index < 1) || (index > g_Players.GetMaxClients()))
@ -144,7 +144,7 @@ static cell_t sm_IsPlayerAuthorized(IPluginContext *pCtx, const cell_t *params)
return (g_Players.GetPlayerByIndex(index)->IsAuthorized()) ? 1 : 0; return (g_Players.GetPlayerByIndex(index)->IsAuthorized()) ? 1 : 0;
} }
static cell_t sm_IsPlayerFakeClient(IPluginContext *pCtx, const cell_t *params) static cell_t sm_IsClientFakeClient(IPluginContext *pCtx, const cell_t *params)
{ {
int index = params[1]; int index = params[1];
if ((index < 1) || (index > g_Players.GetMaxClients())) if ((index < 1) || (index > g_Players.GetMaxClients()))
@ -830,10 +830,11 @@ REGISTER_NATIVES(playernatives)
{"GetMaxClients", sm_GetMaxClients}, {"GetMaxClients", sm_GetMaxClients},
{"GetUserAdmin", GetUserAdmin}, {"GetUserAdmin", GetUserAdmin},
{"GetUserFlagBits", GetUserFlagBits}, {"GetUserFlagBits", GetUserFlagBits},
{"IsClientAuthorized", sm_IsPlayerAuthorized}, {"IsClientAuthorized", sm_IsClientAuthorized},
{"IsClientConnected", sm_IsPlayerConnected}, {"IsClientConnected", sm_IsClientConnected},
{"IsFakeClient", sm_IsPlayerFakeClient}, {"IsFakeClient", sm_IsClientFakeClient},
{"IsPlayerInGame", sm_IsPlayerIngame}, {"IsPlayerInGame", sm_IsClientInGame}, /* Backwards compat shim */
{"IsClientInGame", sm_IsClientInGame},
{"RemoveUserFlags", RemoveUserFlags}, {"RemoveUserFlags", RemoveUserFlags},
{"SetUserAdmin", SetUserAdmin}, {"SetUserAdmin", SetUserAdmin},
{"SetUserFlagBits", SetUserFlagBits}, {"SetUserFlagBits", SetUserFlagBits},

View File

@ -158,7 +158,16 @@ native bool:IsClientConnected(client);
* @param client Player index. * @param client Player index.
* @return True if player has entered the game, false otherwise. * @return True if player has entered the game, false otherwise.
*/ */
native bool:IsPlayerInGame(client); native bool:IsClientInGame(client);
/**
* Backwards compatibility stock - use IsClientInGame
* @deprecated Renamed to IsClientInGame
*/
stock bool:IsPlayerInGame(client)
{
return IsClientInGame(client);
}
/** /**
* Returns if a certain player has been authenticated. * Returns if a certain player has been authenticated.