public uint GetLocalPlayerByAccountName(string AccountName) { foreach (uint PlayerObject in GetPlayers(true)) { if (GetPCPlayerName(PlayerObject) == AccountName) return PlayerObject; } return OBJECT_INVALID; }