MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / GetClientFromSerial

Method GetClientFromSerial

core/PlayerManager.cpp:1950–1970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1948}
1949
1950int PlayerManager::GetClientFromSerial(unsigned int serial)
1951{
1952 serial_t s;
1953 s.value = serial;
1954
1955 int client = s.bits.index;
1956
1957 IGamePlayer *pPlayer = GetGamePlayer(client);
1958
1959 if (!pPlayer)
1960 {
1961 return 0;
1962 }
1963
1964 if (serial == pPlayer->GetSerial())
1965 {
1966 return client;
1967 }
1968
1969 return 0;
1970}
1971
1972#if SOURCE_ENGINE >= SE_ORANGEBOX
1973void CmdMaxplayersCallback(const CCommand &command)

Callers 2

sm_GetClientFromSerialFunction · 0.80
ClientConnectCallbackMethod · 0.80

Calls 1

GetSerialMethod · 0.45

Tested by

no test coverage detected