ALFA.Database.ACR_GetPlayerID C# (CSharp) Метод

ACR_GetPlayerID() публичный Метод

This routine returns the database player ID for a player given their PC object id.
public ACR_GetPlayerID ( UInt32 PCObject ) : int
PCObject System.UInt32 Supplies the object ID of the player to /// query.
Результат int
        public int ACR_GetPlayerID(UInt32 PCObject)
        {
            return Script.GetLocalInt(PCObject, "ACR_PID");
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Dispatch the event (in a script context).
        /// </summary>
        /// <param name="Script">Supplies the script object.</param>
        /// <param name="Database">Supplies the database connection.</param>
        public void DispatchEvent(ACR_ServerCommunicator Script, ALFA.Database Database)
        {
            foreach (uint PlayerObject in Script.GetPlayers(true))
            {
                if (Database.ACR_GetPlayerID(PlayerObject) != Player.PlayerId)
                {
                    continue;
                }

                Database.ACR_IncrementStatistic("DISCONNECT_PLAYER");
                Script.WriteTimestampedLogEntry("DisconnectPlayerEvent.DispatchEvent: Disconnecting player " + Script.GetPCPlayerName(PlayerObject) + " due to IPC request.");
                Script.BootPC(PlayerObject);
                return;
            }

            Script.WriteTimestampedLogEntry("DisconnectPlayerEvent.DispatchEvent: No player '" + Player.PlayerName + "' found locally connected to disconnect.");
        }
All Usage Examples Of ALFA.Database::ACR_GetPlayerID